We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

60359 May 3,2007 04:23 AM May 4,2007 09:47 PM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Naveed Afzaal
Asked On May 3, 2007 04:23 AM

Hi,

i am assigning the data and appearance
(i-e Font , Colheder appearance and cell
apperance) using the "TableModel" object of GridGroupingControl.

for examle,
objGridgroupingControl.Table.TableMode.ColCount=4

But the value of ColCount of GridGroupingControl
does not change.
Why?

Regards
Naveed Afzaal

Administrator [Syncfusion]
Replied On May 3, 2007 06:26 PM

Hi Naveed,

You can apply the appearance settings for ColumnheaderCell and RecordFieldcell using the below code snippet.


//Applies the TextColor settings for both ColumnHeader and RecordFieldCell
this.GridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.TextColor = Color.DimGray;
this.GridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.TextColor = Color.DimGray;

//Applies the Font settings for ColumnHeadercell
this.GridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.Facename = "Monotype Corsiva";

Attached is the sample for your ready references.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.0/F60359/GridGroup_Forum60359/main.htm

this.GridGroupingControl1.Table.TableModel.ColCount will always holds the number of columns in the Grid. Changing it doesn't make any sense. i.e "ColCount" will get changed only when the new columns are get added to GridGroupingControl.

Let us know if you need any other help.

Thanks for using Syncfusion products.

Regards,
Gokulkumar B

Naveed Afzaal
Replied On May 4, 2007 02:02 AM

Hi Gokulkumar B,

The sample u have given applies apperance to all cloumns and data in table.

There are three things which i want to achieve.

1) I want to apply apperance settings on column Header ( i-e font , Color ,Bold). These settings varies from column to column in a grid.

2) I want to apply the currency(i-e $,#) to all cell values for a particular column.

3) I want to apply the apperance properties
(i-e back color,font) to "selective" cell values of a column in a grid.

How can i do above all?

Regards
Naveed Afzaal

>Hi Naveed,

You can apply the appearance settings for ColumnheaderCell and RecordFieldcell using the below code snippet.


//Applies the TextColor settings for both ColumnHeader and RecordFieldCell
this.GridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.TextColor = Color.DimGray;
this.GridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.TextColor = Color.DimGray;

//Applies the Font settings for ColumnHeadercell
this.GridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.Facename = "Monotype Corsiva";

Attached is the sample for your ready references.

http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.0/F60359/GridGroup_Forum60359/main.htm

this.GridGroupingControl1.Table.TableModel.ColCount will always holds the number of columns in the Grid. Changing it doesn't make any sense. i.e "ColCount" will get changed only when the new columns are get added to GridGroupingControl.

Let us know if you need any other help.

Thanks for using Syncfusion products.

Regards,
Gokulkumar B

Gokul B [Syncfusion]
Replied On May 4, 2007 09:47 PM

Hi Naveed,

Thanks for your update.

Here is my answer for your query.

* Below sequence of code snippet will answers your (1) and (3) query.

GridTableDescriptor desc = this.GridGroupingControl1.TableDescriptor;
//Applies the Color and Font setting based on the Columnn Index
desc.Columns[0].Appearance.ColumnHeaderCell.TextColor = Color.Red;
desc.Columns[1].Appearance.ColumnHeaderCell.Font.Facename = "MS Serif";

//Applies the Color and Font setting based on the Columnn Name
desc.Columns.FindByMappingName("Title").Appearance.ColumnHeaderCell.TextColor = Color.RosyBrown;
desc.Columns.FindByMappingName("Address").Appearance.ColumnHeaderCell.Font.Facename = "Impact";

* You can apply the dollar ($) values based on columns using QueryStyleInfo event which occurs for each cell before it gets rendered. Please have a look at our below code for your references.

protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
if (e.TableCellIdentity.Column.MappingName == "Title")
{
String str = e.Style.Text;
e.Style.Text = str + "$";

}
}
}

Let us know if you need any other help.

Regards,
Gokulkumar B

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;