Coloring the DataGrid

Results 1 to 2 of 2

Thread: Coloring the DataGrid

  1. #1
    Join Date
    Dec 1969

    Default Coloring the DataGrid

    Hi! trying to color my datagrid depending on the value that i retrive from my db...i try this:<BR>Sub MySub(sender as object, e as DatGridItemEventArgs)<BR>....<BR>if MyValue = 1 then<BR> DatGrid.Items(e.item.ItemIndex).BackColor = System.Drawing.Color.Red<BR>else<BR>....<BR>end if<BR>End Sub<BR><BR>but it keeps sending me a message of <BR><BR>System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection<BR><BR>....what can I do??...i call this Sub in the OnItemDataBound of my Datagrid....Thanks to all for all!!.<BR>Saludos!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Coloring the DataGrid

    whats the MyItem = 1 all about?<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts