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

Using UpDownEditor in SFDataGrid?

Hi,
May I know if it is possible to use UpDownEditor or something similar with SFDataGrid?

I read from another forum post that it seems SFDataGrid does support UpDownEditor but I have no idea how to use it

https://www.syncfusion.com/forums/115589/datagrid-fastdatagrid

6 Replies

FP Farjana Parveen Ayubb Syncfusion Team July 30, 2014 09:11 AM UTC

 

Hi Tony,

 

Thank you for contacting Syncfusion Support.

 

We analyzed your query. We regret to inform you that UpDownEditor column is not supported in SfDataGrid WPF. But, you can achieve your requirement by using GridTemplateColumn in SfDataGrid. In <GridTemplateColumn.EditTemplate> , we can set the UpDown Coloumn.

 

Please refer the following code snippet and sample in the following location:

 

Code Snippet:

 

<syncfusion:GridTemplateColumn MappingName="OrderID">

                    <syncfusion:GridTemplateColumn.CellTemplate>

                        <DataTemplate>

                            <TextBlock Text="{Binding OrderID}"/>

                        </DataTemplate>

                    </syncfusion:GridTemplateColumn.CellTemplate>

                    <syncfusion:GridTemplateColumn.EditTemplate>

                        <DataTemplate>

                          <syncfusion:UpDown Value="{Binding OrderID}" MaxValue="1010" MinValue="1000"/>

                        </DataTemplate>

                    </syncfusion:GridTemplateColumn.EditTemplate>

                </syncfusion:GridTemplateColumn>

 

 

Regards,

Farjana Parveen A

 


Attachment: UpDownColumn_Sample_dc4294e8.zip


TL Tony Leung July 31, 2014 01:13 AM UTC

Hi Farjana,

Thank you for the quick response, just follow up a little bit more.
In the example, do you have any idea how can I make the text in the UpDownEditor be selected after i double clicked the cell ?


FP Farjana Parveen Ayubb Syncfusion Team July 31, 2014 10:33 AM UTC

Hi Tony,

 

Sorry about the inconvenience caused.

 

We analyzed your query. We regret to inform you that text in the GridTemplateColumn is not selected while double clicked the cell. You can achieve your requirement by CustomColumn and CustomRender  concept. We can create the column in custom and we set the CustomRender for that column. In the Render we specified our column type UpDown.

 

Please refer the sample in the following location:

 

Regards,

Farjana Parveen


Attachment: UpDownColumn_Custom_Sample_63962914.zip


TL Tony Leung August 4, 2014 10:36 AM UTC

Hi,

Thank you for the response.
Just one more question.
My application is a client-server application that the ModelView will be updated by server
and i encounter a case like that:

1. The UpDownEditor is Editing
2. An update from server is received and updated the ModelView
3. Since the UpDownEditor is binding to the ModelView, the new value is applied and thus, the editing value is lost.

Is that possible to make the editor to ignore the modelView update when it is in editing mode?
I did try to set Binding Mode = OneWayToSource.
However, it becomes that the UpDownEditor can't get the current cell value when it is entering edit mode. 


FP Farjana Parveen Ayubb Syncfusion Team August 5, 2014 01:55 PM UTC

Hi Tony,

 

Sorry about the inconvenience caused.

 

We analyzed your query. We regret to inform you that while editing the value it is updated in the modelview this is a behavior of  SfDataGrid. Because both the underlying collection and the cellvalues is in the binding state.

 

Regards,

Farjana Parveen A



RU Ruby August 20, 2014 07:21 AM UTC

Hi,

I tried the previous two sample applications and would like to know if it is possible to give up the change of the cell of UpDownEditor by pressing the Esc?

It works for the cells using TextBoxEditor but not the UpDownEditor

Loader.
Live Chat Icon For mobile
Up arrow icon