We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

QueryCellFormattedText

I''ve written QueryCellFormattedText and SaveCellFormattedText handlers to format a uint to/from hexidecimal format. I ran into problems because although there is only 1 row in the grid, my handler is called with row==0, row==1, row==2. Can you tell my why? Here''s my code: private void dbgBoardsModel_QueryCellFormattedText(object sender, GridCellTextEventArgs e) { int row = e.Style.CellIdentity.RowIndex; int col = e.Style.CellIdentity.ColIndex; if (col == iBoardBaseAddressColIndex) { try { uint ui = (uint) e.Value; e.Text = ui.ToString("x"); } catch (Exception ex) { string str = ex.Message; } e.Handled = true; } }

2 Replies

AD Administrator Syncfusion Team February 6, 2005 03:10 PM

Ken, row 0 is the row with column headers. row 1 is your first row with data. row 2 is the AddNew row. Stefan >I''ve written QueryCellFormattedText and SaveCellFormattedText handlers to format a uint to/from hexidecimal format. I ran into problems because although there is only 1 row in the grid, my handler is called with row==0, row==1, row==2. Can you tell my why? Here''s my code: > >private void dbgBoardsModel_QueryCellFormattedText(object sender, GridCellTextEventArgs e) >{ > int row = e.Style.CellIdentity.RowIndex; > int col = e.Style.CellIdentity.ColIndex; > if (col == iBoardBaseAddressColIndex) > { > try > { > uint ui = (uint) e.Value; > e.Text = ui.ToString("x"); > } > catch (Exception ex) > { > string str = ex.Message; > } > e.Handled = true; > } >}


KL Ken Law February 9, 2005 09:48 PM

Thanks - makes sense.

Loader.
Live Chat Icon For mobile
Up arrow icon