How do you customize the column content inside the datagrid?
Answer Posted / ashutosh rai
We will add a function signature of OnItemDataBind in
DataGrid or by creating an event handler in code file for
DataGrid Binding. Now in the definition of function we will
check that is DataGrid Item type is of ListItemType or
AlternatingItemType then we will costomize the column by
setting the property of particular column in code window.
for eg.
event handler of funcion:
this.DataGrid.ItemDataBound += new
system.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid_ItemDataBound);
definition of function:
private void DataGrid_ItemDataBound(object sender,
DataGridItemEventArgs e)
{
if (e.Item.ItemType ==
ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
e.Item.Cells[1].Font.Bold;
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which event occurs when a user drags an item in a treeview or listview control?
which property is used to change to some value to access a identity column in datacontrols?
How do I change the console application in windows?
Can you create a tabletype of recordset in Jet - connected ODBC dbengine?
Name the property which is used to specify the source from where the crystal reports would be accessed.
Which of the following position is the default docking position of the statusstrip control on the form?
How to show a ContextMenuStrip instead of cthe default ContextMenuStrip,when you rightclick on the non client area of a window's Form or when alt+space keys are pressed
How can you pause a timer control?
What is a fillable form?
How to create a set up in vb.net for desktop application please say steps with examples?
What is the difference between the add() and insert() methods of a listbox control?
What are windows based applications examples?
How will calculated the net amount in tax add like total net amount = LT+ST+CESS+amount 2500 = 10%+12.5%+5.15%+amount? kindly please explain what type of formula we apply in software? Tushar
What is form design?
How many navigational features are provided by visual studio.net ide?