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

Issue with GridViewCheckBoxColumn in GridView

3 Answers 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 10 Jan 2014, 12:46 PM
Hello Support,

I am using the telerik's silverlight RadGridview control for editing,deleting and inserting data to the database. We got a sield called "status" which is of type tinyint. I am using a checkboxcolumn for displaying this field and when user clicks on the checkbox status should be updated accordingly. I am using WCF riaservice to link the database to radcontrol for its operations. Everything  including editing is working fine apart from an issue in display of the checkbox.
When the page is loading the checkbox is showing with a 'hyphen' and it will show the checkbox with status (check or uncheck) only after we click on this cell. How can I get ridoff this 'hyphen' that comes initially and show the checked/unchecked status on the page load itself. Please note that I tried out the alternate way as well, that is using a checkbox inside GridviewDatacolumn. In that case initially ther eis no checkbox. It will be displayed only on clicking on the cell. This same DB is working fine as expected for microsoft's datagrid control.

I am attaching the image of the gridview result. Also I am attaching the xaml code as below.

<telerik:RadGridView x:Name="GridvwCategory" AutoGenerateColumns="False" ShowGroupPanel="False" RowEditEnded="GridvwCategory_RowEditEnded">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" IsFilterable="False"/>
                <telerik:GridViewCheckBoxColumn Header="Status" IsThreeState="False"  AutoSelectOnEdit="True" EditTriggers="CellClick"  IsFilterable="False" IsSortable="False" DataMemberBinding="{Binding Status, Mode=TwoWay}" IsVisible="True"/>               
</telerik:RadGridView.Columns>


Regards,
Rajesh

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 14 Jan 2014, 01:34 PM
Hello Rajesh,

The 'hyphen' mean that the value behind is null. Is it null, or is it a valid value you have for the Status? You say that when you are using a CheckBox inside GridViewDataColumn - there is no CheckBox at all until you click on it. What do you see after you click on it? How have you bound this CheckBox? What are the values of the bound property?

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Rajesh
Top achievements
Rank 1
answered on 15 Jan 2014, 04:31 AM
Hello Didie,

Thanks for your reply.

'Status' field is of type tiny int and all the fields contains a non-null value (either a 1 or 0) . I tried to use checkbox inside GridViewDataColumn only because it was having issues with GridViewCheckBoxColumn which was binding the 'Status' field mentioned above. I will paste the code used for GridViewDatacolumn.

<telerik:GridViewDataColumn Header="Status" Width="80"  EditTriggers="CellClick"  IsGroupable="False" IsSortable="False" IsFilterable="False" IsVisible="True" >
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ChkStatus" Margin="5"  IsChecked="{Binding Status, Mode=TwoWay}"  />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>


When using like this, initially the field appear as blank and when we click on the cell, checkbox will appear inside that cell with the value loaded. I am attaching an image which has the value of status, column that uses gridviewcheckbox, and column that uses gridviewdatacolumn.

Regards,
Rajesh
0
Dimitrina
Telerik team
answered on 16 Jan 2014, 12:46 PM
Hi,

Thank you for sending us a project to illustrate your problem. Please lets continue the further communication in the support thread you have opened.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Rajesh
Top achievements
Rank 1
Share this question
or