Community discussion forum

Checking Datagridview row validity

  • 6 months ago

    Hi

    I want to check on datagridview leave event if it contains any invalid rows. If so than the disable button should be disabled. Do anyone have any ideas about this,please share. Thanks any way.

    Shahbaz Maqsood

    Post was edited on 17/05/2009 05:51:36 Report abuse
  • 6 months ago

    If u are checking if it contains invalid rows in web application then it is better to fire *DataGrid RowDataBound *Event rather than Leave Event..

    It is better to fire this event...bcz it get called immediately after u assign datasource to datagrid... In these u check it...

    if (e.Row.RowType == DataControlRowType.DataRow) { //check u r conditions here...u can do it..u need do for loop here.. bcz it will loop as many times as the data in grid.It will help u check every row in datagrid. }

    Thanks & Regards Viral Gandhi

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback