Highlight Datagrid row based on a column value
I've searched for this in the forums but could not find an answer, can anybody help?
I want to Highlighting a Datagrid Row based on a column value
I've refreshed my DataGrid and now I want to go to the row that contains a specific value.
ie, 2 Columns NAME, ID
1000 rows.
I want to highlight the Row with ID = 700
This does not seem to work:
Code:
Dim x As Integer
'
' the count of rows is in the Tag.
For x = 0 To CInt(dgMPANS.Tag) - 1
If CType(dgMPANS.Item(x, 1), String) = strSelectedMPAN Then
dgMPANS.CurrentCell = New DataGridCell(x, 1)
Exit Sub
End If
Next
Re: Highlight Datagrid row based on a column value
Hi there
I also face the same issue but the link supplied by you doesnt work anymore.
If anyone has soluton to this problem please post it here
Re: Highlight Datagrid row based on a column value
Quote:
Originally Posted by
ibuksh
Hi there
I also face the same issue but the link supplied by you doesnt work anymore.
If anyone has soluton to this problem please post it here
Back when this thread was created the DataGridView control didn't exist and this question was for the DataGrid control. Presumably you are using a DataGridView, correct? The best way to achieve your aim depends on how you populated the grid in the first place. Is your grid bound to a data source, e.g. a DataTable, or did you insert the data directly.
Re: Highlight Datagrid row based on a column value
i can acheive this with a datagridview control in VS2005 but the project I am working on is VS2003 and it has only a datagrid control and not datagridview control so my issue remains
would appreciate any help possible
Re: Highlight Datagrid row based on a column value
Quote:
Originally Posted by
ibuksh
i can acheive this with a datagridview control in VS2005 but the project I am working on is VS2003 and it has only a datagrid control and not datagridview control so my issue remains
would appreciate any help possible
I see. This looks like the link you want:
http://www.syncfusion.com/FAQ/window...44c.aspx#q745q
Looks like the web site was changed from ASP (.asp) to ASP.NET (.aspx).
Re: Highlight Datagrid row based on a column value
Thanks for the help mate
I also found another solution that is an easier approach
Datagrid Row Color
its built around similar logic though