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.
Unfortunately, activation email could not send to your email. Please try again.

QueryCellFormattedText

Thread ID:

Created:

Updated:

Platform:

Replies:

24526 Feb 5,2005 05:01 PM Feb 9,2005 09:48 PM Windows Forms 2
loading
Tags: GridControl
Ken Law
Asked On February 5, 2005 05:01 PM

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; } }

Administrator [Syncfusion]
Replied On 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; > } >}

Ken Law
Replied On February 9, 2005 09:48 PM

Thanks - makes sense.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;