I am looking for rowdata bound event that we have in asp.net gridview. What I am trying to achieve is this.
e.row.rowtype == datacontrolrowtype.datarow
on data bound event of webdata grid , but it is not working so how can I achieve this. Suggestion on how get the type of row and its event would be helpful.
Ok, not 100% sure what you mean by achieving 'this' but.. WebDataGrid offers 2 versions of such events so whatever you are attempting would probably have to do with these. As far as I get your line of code you are interested in data rows only and the following row-related events are fired only for data rows as far as I'm aware(definitely not for headers or Summary rows from my experience):
Server side: The InitializeRow event is raised when the grid binds to the records in the data source. You can find that in the general control Properties or add it at top level in the markup with <ig:WebDataGrid oninitializerow="WebDataGrid1_InitializeRow"...
Within the handler you have access to both the grid and the row and this event is fired for each data row, always:
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e)
{
// Use:
//e.Row.DataItem
//e.Row.DataKey
//e.Row.Index
}
Client Side Row Rendered /-ing event, that is fired only when client side binding/rendering is enabled. Event fired after / before a row is rendered to the DOM, set up by adding <ClientEvents RowRendered="test" />
where test is the name of the handler function in JavaScript:
function test(webDataGrid, evntArgs) {
//The data object with all attributes
evntArgs.get_dataItem();
//Reference to the actual TR element
evntArgs.get_rowElement();
//Returns index of the row inside of its container collection.
evntArgs.get_index();
//Returns data key of the row. It is always an array of objects even in a case of a single data key field.
evntArgs.get_dataKey();
}
I think you should be able to do what you want to do with those.