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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

gridGroupingControl1 Copy/Paste

Thread ID:

Created:

Updated:

Platform:

Replies:

32217 Jul 25,2005 02:51 PM UTC Jul 29,2005 01:32 PM UTC WinForms 1
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On July 25, 2005 02:51 PM UTC

In my gridGroupingControl, i have rows like that: (Row3 is calculated from Row2/Row1,Row 6 is calculate from Row5/Row4, User also can key Row3 and Row 6, ): Row1 10 20 30 Row2 2 5 6 Row3 20% 25% 20% Row4 20 20 40 Row5 4 5 8 Row6 20% 25% 20% I have to question below: 1.now, I using TableControlCurrentCellAcceptedChanges to handle it,if Row1 or Row2 changed,i can calculate Row3 and Row6 in this event.But copy/past do not hire this event,how can i do to let paste(Ctrl+V) row3=row2/row1 and Row6=Row5/Row4? 2. i use Model_QueryCellFormattedText/Model_SaveCellFormattedText to format Row3 and Row6 in Model_QueryCellFormattedText //if is row3 or Row 6 double d; if(double.TryParse(e.Style.Text, System.Globalization.NumberStyles.Any, null, out d)) { //e.Text = e.Style.Text + " %"; d=d*100; d=System.Math.Round(d,2); e.Text = d.ToString() + "%"; e.Style.Format="###0.##%"; e.Handled = true; } in Model_SaveCellFormattedText //if Row3 or row6 if(e.Text.EndsWith("%")) { e.Style.Text = e.Text.Substring(0, e.Text.Length - 1); e.Handled = true; } break; , If i Copy row3 to row 6:(copy 20% ,but paste is 2000% )How can i handle it?

Administrator [Syncfusion]
Replied On July 29, 2005 01:32 PM UTC

Hi Cradle, in your Model_SaveCellFormattedText you can convert the string into a number, e.g. double d; if (double.TryParse(e.Text.Substring(0, e.Text.Length - 1), out d) { e.Style.CellValue = d/100; e.Handled = true; } Stefan >In my gridGroupingControl, > >i have rows like that: >(Row3 is calculated from Row2/Row1,Row 6 is calculate from Row5/Row4, User also can key Row3 and Row 6, >): >Row1 10 20 30 >Row2 2 5 6 >Row3 20% 25% 20% >Row4 20 20 40 >Row5 4 5 8 >Row6 20% 25% 20% > >I have to question below: >1.now, I using TableControlCurrentCellAcceptedChanges to handle it,if Row1 or Row2 changed,i can calculate Row3 and Row6 in this event.But copy/past do not hire this event,how can i do to let paste(Ctrl+V) row3=row2/row1 and Row6=Row5/Row4? >2. i use Model_QueryCellFormattedText/Model_SaveCellFormattedText to format Row3 and Row6 > >in Model_QueryCellFormattedText >//if is row3 or Row 6 >double d; > if(double.TryParse(e.Style.Text, System.Globalization.NumberStyles.Any, null, out d)) > { > //e.Text = e.Style.Text + " %"; > d=d*100; > d=System.Math.Round(d,2); > e.Text = d.ToString() + "%"; > e.Style.Format="###0.##%"; > e.Handled = true; > } > >in Model_SaveCellFormattedText >//if Row3 or row6 >if(e.Text.EndsWith("%")) > { > e.Style.Text = e.Text.Substring(0, e.Text.Length - 1); > e.Handled = true; > } > break; > >, >If i Copy row3 to row 6:(copy 20% ,but paste is 2000% )How can i handle it? >

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.

Warning Icon 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.Close Icon

;