This is a migrated thread and some comments may be shown as answers.

Dropdowncolumn showing value only in edit mode

3 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Felice
Top achievements
Rank 1
Felice asked on 10 Apr 2014, 09:59 PM
I have 3 dropdowncolumns in this radGrid.
The first one "Pnum" is working well, I can select the value and save it, and the saved value is visible in the grid when not in edit mode. If I open the record in edit mode the dropdown stays on the selected value unless I select a new value.
The other two dropdowncolumns are giving me problems. The selected value is saved to the db but is not visible when the grid is not in edit mode and if I open the record in edit mode after having saved it,  the dropdown value is on the default value.

How can I have the two dropdowncolumns "minutes" and "hours" acting like the "Pnum" column? Why they are acting in a different way?

I mean after selecting the value and update the record have the value shown in the grid. 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Culture="it-IT" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" Skin="Outlook" CellSpacing="-1" GridLines="Both">
                       <ExportSettings>
                           <Pdf PageWidth="">
                           </Pdf>
                       </ExportSettings>
                       <ClientSettings>
                           <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                       </ClientSettings>
                       <MasterTableView DataKeyNames="Id" DataSourceID="SqlDataSource1" CommandItemDisplay="Top">
                           <Columns>
                               <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                   <HeaderStyle Width="35px" />
                               </telerik:GridEditCommandColumn>
                               <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="60px" />
                               </telerik:GridBoundColumn>
                               <telerik:GridDateTimeColumn DataField="Date" DataType="System.DateTime" FilterControlAltText="Filter Date column" HeaderText="Date" SortExpression="Date" UniqueName="Date" DataFormatString="{0:dd/MM/yyyy}">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDateTimeColumn>
                               <telerik:GridDropDownColumn DataField="Pnum" DataSourceID="SqlDataSource2" ListTextField="Pnum" ListValueField="Pnum"  FilterControlAltText="Filter column column" UniqueName="column" HeaderText="P-Number">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
 
                               <telerik:GridBoundColumn DataField="WorkedTime" DataType="System.TimeSpan" FilterControlAltText="Filter WorkedTime column" HeaderText="Worked Time" SortExpression="WorkedTime" UniqueName="WorkedTime">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="90px" />
                               </telerik:GridBoundColumn>
                               <telerik:GridBoundColumn DataField="Week" FilterControlAltText="Filter Week column" HeaderText="Week" SortExpression="Week" UniqueName="Week">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="60px" />
                               </telerik:GridBoundColumn>
 
 
                               <telerik:GridDropDownColumn DataField="minutes" DataSourceID="SqlDataSource3" ListTextField="minutes" ListValueField="minutes"  FilterControlAltText="Filter minutes column" UniqueName="minutes" HeaderText="Minutes" DataType="System.Int16">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
                               <telerik:GridDropDownColumn DataField="hours" DataSourceID="SqlDataSource4" ListTextField="hours" ListValueField="hours"  FilterControlAltText="Filter hours column" UniqueName="hours" HeaderText="Hours" DataType="System.Int16">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                                   <HeaderStyle Width="80px" />
                               </telerik:GridDropDownColumn>
                               <telerik:GridBoundColumn  DataField="Note" FilterControlAltText="Filter Note column" HeaderText="Note" SortExpression="Note" UniqueName="Note">
                                   <ColumnValidationSettings>
                                       <ModelErrorMessage Text="" />
                                   </ColumnValidationSettings>
                               </telerik:GridBoundColumn>
                               <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="column1">
                                   <HeaderStyle Width="30px" />
                               </telerik:GridButtonColumn>
                           </Columns>
                           <EditFormSettings>
                               <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                           </EditFormSettings>
                       </MasterTableView>
                   </telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Apr 2014, 04:43 AM
Hi Felice,

This issue was fixed in the latest releases. Please try upgrading to latest version.
Please take a look at this forums which discusses about this issue:
http://www.telerik.com/forums/griddropdowncolumn-in-radgrid-not-working#kjsmxmE77EqkKuj5B4RBUQ
http://www.telerik.com/forums/radgrid-missing-column-values#YRqLE2f4Vkq9ES3nsR5hzQ

Thanks,
Princy
0
Felice
Top achievements
Rank 1
answered on 11 Apr 2014, 05:00 AM
Hi Princy,
I am using the latest update Q1 2014. As you can see in the code I posted, the 3 dropDownColumns are 100% identical. But still the first one is working and the other two are not working. I am not coming right.
0
Kostadin
Telerik team
answered on 15 Apr 2014, 10:41 AM
Hello Felice,

I was unable to replicate the issue which you have described by using the latest version of RadControls(SP1 Q1 2014). I prepared a small sample and attached it to this thread. Please give it a try and let me know how it differs from your real setup.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Felice
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Felice
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or