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 template creates a .net compact framework 2.0 forms application for pocket pc 2003 and later?
Which window allows viewing the resources of the servers, such as services, processes and the event log?
What is an example of form?
What is the difference between desktop application and windows application?
What is dynamic linking?
What is form and its types?
Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control.
Explain how insert record in the database?
What is the advantage of a form?
Where is system windows forms dll?
What are the three states set in a checkstate property?
Explain the new events in textbox that has been included in vb?
What are the components of gui for windows?
How to create a set up in vb.net for desktop application please say steps with examples?