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

Missing some icon

6 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 2
Iron
Iron
Pierre asked on 08 Apr 2008, 08:57 PM
Hi, iI use the new Release 2008 Beta for Prometheus dll.

With the RadGrid I use a 2 level hierarchy. All work good except that at the initial load page some icon are missing in the grid. For example the expand "+" icon and the New Item icon do not appear but are present. If I click at the location that icon should be displayed the expand work. Same thing append if I click were the Add icon sould be.

After I click on one of the "invisible" icon for the firts time, all missing icon are corretly displayed.

Any suggestion? Here my aspx grid part:
                    <telerik:RadGrid ID="RadGridSections" runat="server" Skin="Telerik" ShowStatusBar="true" 
                        Width="95%" AutoGenerateColumns="False" PageSize="3" AllowSorting="True" AllowMultiRowSelection="False" 
                        AllowPaging="True" GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
                        OnItemUpdated="RadGrid1_ItemUpdated" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnInsertCommand="RadGrid1_InsertCommand">  
                        <PagerStyle Mode="NumericPages"></PagerStyle> 
                        <MasterTableView AllowMultiColumnSorting="True" Width="100%" CommandItemDisplay="Top" Name="Section">  
                            <DetailTables> 
                                <telerik:GridTableView Width="100%" runat="server" CommandItemDisplay="Top" Name="SousSec">  
                                    <ParentTableRelation> 
                                        <telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="ID" /> 
                                    </ParentTableRelation> 
 
                                    <Columns> 
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">  
                                            <HeaderStyle Width="20px" /> 
                                            <ItemStyle CssClass="MyImageButton" /> 
                                        </telerik:GridEditCommandColumn> 
                                        <telerik:GridBoundColumn UniqueName="ID" HeaderText="ID" DataField="ID" Visible="false"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="Nom" HeaderText="Nom" DataField="Nom"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="NomEng" HeaderText="NomEng" DataField="NomEng"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="Position" HeaderText="Position" DataField="Position"></telerik:GridBoundColumn> 
                                        <telerik:GridCheckBoxColumn UniqueName="Visible" HeaderText="Visible" DataField="Visible"></telerik:GridCheckBoxColumn> 
                                        <telerik:GridButtonColumn ConfirmText="Effacer cette section?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn2">  
                                            <HeaderStyle Width="20px" /> 
                                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                        </telerik:GridButtonColumn> 
                                    </Columns> 
                                    <SortExpressions> 
                                        <telerik:GridSortExpression FieldName="Position" SortOrder="Descending"></telerik:GridSortExpression> 
                                    </SortExpressions> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                            <Columns> 
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">  
                                    <HeaderStyle Width="20px" /> 
                                    <ItemStyle CssClass="MyImageButton" /> 
                                </telerik:GridEditCommandColumn> 
                                <telerik:GridBoundColumn UniqueName="ID" HeaderText="ID" DataField="ID" Visible="false"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Nom" HeaderText="Nom" DataField="Nom"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="NomEng" HeaderText="NomEng" DataField="NomEng"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Position" HeaderText="Position" DataField="Position"></telerik:GridBoundColumn> 
                                <telerik:GridCheckBoxColumn UniqueName="Visible" HeaderText="Visible" DataField="Visible"></telerik:GridCheckBoxColumn> 
                                <telerik:GridButtonColumn ConfirmText="Effacer cette section?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
                                    <HeaderStyle Width="20px" /> 
                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                </telerik:GridButtonColumn> 
                            </Columns> 
                            <SortExpressions> 
                                <telerik:GridSortExpression FieldName="Position"></telerik:GridSortExpression> 
                            </SortExpressions> 
                        </MasterTableView> 
                    </telerik:RadGrid>                  
 

6 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 09 Apr 2008, 10:28 AM
Hello Pierre,

The icons are displayed as expected with the Futures build. Although not with the same Skin, a similar example is available here:

http://www.telerik.com/demos/aspnet/prometheus-futures/Grid/Examples/Hierarchy/TwoTablesAtLevel/DefaultCS.aspx

Have you tried changing the Skin? Also, do you use the FormDecorator on the same page by any chance? It may hide the Grid image buttons if you have left it to decorate all the buttons on the page. Please, check the DecoratedControls value.

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 09 Apr 2008, 03:34 PM
you are right, the FormDecorator cause the problem . I remove it form this page and all work good now.

By the way, with this new radGrid in the updateCommand this code are OK to retreive the new value or you have new method:
Protected Sub RadGridSections_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridSections.UpdateCommand  
          
  Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
 
  Dim newValues As Hashtable = New Hashtable e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)  
End Sub 

Now if I need to retreive the oldValue I try to use: editedItem.SavedOldValues but the coutn are always 0. Any suggestion?

Last thing for an unknow reason the InsertCommand are always called 2 time. That add 2 row in the DB. I use manual update method. My code are:
                    <telerik:RadGrid ID="RadGridSections" runat="server" Skin="WebBlue" ShowStatusBar="true" 
                        Width="95%" AutoGenerateColumns="False" PageSize="10" AllowSorting="True" AllowMultiRowSelection="False" 
                        AllowPaging="True" GridLines="None" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" 
                        OnItemUpdated="RadGrid1_ItemUpdated" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnInsertCommand="RadGrid1_InsertCommand">  
                        <PagerStyle Mode="NumericPages"></PagerStyle> 
                        <MasterTableView AllowMultiColumnSorting="True" Width="100%" CommandItemDisplay="Top" Name="Section">  
                            <DetailTables> 
                                <telerik:GridTableView Width="100%" runat="server" CommandItemDisplay="Top" Name="SousSect">  
                                    <Columns> 
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">  
                                            <HeaderStyle Width="20px" /> 
                                            <ItemStyle CssClass="MyImageButton" /> 
                                        </telerik:GridEditCommandColumn> 
                                        <telerik:GridBoundColumn UniqueName="ID" HeaderText="ID" DataField="ID" Visible="false"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="ParentID" HeaderText="ParentID" DataField="ParentID" Visible="false"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="Nom" HeaderText="Nom" DataField="Nom"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="NomEng" HeaderText="NomEng" DataField="NomEng"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn UniqueName="Position" HeaderText="Position" DataField="Position"></telerik:GridBoundColumn> 
                                        <telerik:GridCheckBoxColumn UniqueName="Visible" HeaderText="Visible" DataField="Visible"></telerik:GridCheckBoxColumn> 
                                        <telerik:GridButtonColumn ConfirmText="Effacer cette section?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn2">  
                                            <HeaderStyle Width="20px" /> 
                                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                        </telerik:GridButtonColumn> 
                                    </Columns> 
                                    <SortExpressions> 
                                        <telerik:GridSortExpression FieldName="Position" SortOrder="Descending"></telerik:GridSortExpression> 
                                    </SortExpressions> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                            <Columns> 
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">  
                                    <HeaderStyle Width="20px" /> 
                                    <ItemStyle CssClass="MyImageButton" /> 
                                </telerik:GridEditCommandColumn> 
                                <telerik:GridBoundColumn UniqueName="ID" ReadOnly="true" HeaderText="ID" DataField="ID" Visible="false"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Nom" HeaderText="Nom" DataField="Nom"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="NomEng" HeaderText="NomEng" DataField="NomEng"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Position" HeaderText="Position" DataField="Position"></telerik:GridBoundColumn> 
                                <telerik:GridCheckBoxColumn UniqueName="Visible" HeaderText="Visible" DataField="Visible"></telerik:GridCheckBoxColumn> 
                                <telerik:GridButtonColumn ConfirmText="Effacer cette section?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">  
                                    <HeaderStyle Width="20px" /> 
                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                </telerik:GridButtonColumn> 
                            </Columns> 
                            <SortExpressions> 
                                <telerik:GridSortExpression FieldName="Position"></telerik:GridSortExpression> 
                            </SortExpressions> 
                        </MasterTableView> 
                    </telerik:RadGrid>                  
 

VB:
    Protected Sub RadGrid1_InsertCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) Handles RadGridSections.InsertCommand  
 
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
        Dim newValues As Hashtable = New Hashtable  
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)  
 
        If "Section".Equals(e.Item.OwnerTableView.Name) Then 
            oSection.Ajoute(newValues)  
        ElseIf "SousSect".Equals(e.Item.OwnerTableView.Name) Then 
            oSection.Ajoute(newValues)  
        End If 
    End Sub 
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 09 Apr 2008, 07:46 PM
I found that the ExtractValuesFromItem do not work verry well for me. I add a formTemplate and use RadNumericTexbox and RadComboBox. I do the updating binding in the ItemDataBound like this:
    Protected Sub RadGridSections_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridSections.ItemDataBound  
        If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then  
 
            Dim editedItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)  
            Dim txtNumber As RadNumericTextBox = DirectCast(editedItem.FindControl("RadNumericTextBoxPosition"), RadNumericTextBox)  
            Dim cboParent As RadComboBox = DirectCast(editedItem.FindControl("RadComboBoxParent"), RadComboBox)  
 
            txtNumber.Value = Convert.ToInt32(editedItem.Item("Position").Text)  
 
            oSection.FillCombo(cboParent)  
            cboParent.SelectedValue = editedItem.Item("ParentID").Text  
 
        End If 

but I can't retreive in the ExtratedValuesFromItem the value if I don't use the "Bind()" in the aspx template part.

How can I retrive the new and old value of my comboBox selectedValue? I try this for retreiving the new value, but I can't found for the old one.:
    Protected Sub RadGridSections_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridSections.UpdateCommand  
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
        Dim newValues As Hashtable = New Hashtable  
 
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)  
 
        Dim nID As Int32 = Convert.ToInt32(e.Item.OwnerTableView.Items(e.Item.ItemIndex)("ID").Text)  
        Dim cboParent As RadComboBox = DirectCast(editedItem.FindControl("RadComboBoxParent"), RadComboBox)  
        Dim txtNumber As RadNumericTextBox = DirectCast(editedItem.FindControl("RadNumericTextBoxPosition"), RadNumericTextBox)  
 
        Dim NewValue as string = cboParent.SelectedValue  
        Dim OldValue as string = ??????????? 
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 09 Apr 2008, 08:17 PM
Sorry for posting again, but my question are in the code posted above. When I try to add a new item in the grid I got this error: " COnverting from DBNull to Boolean are not valid." I got this error on this line: 

<

asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind( "Visible") %>' />

I think is in the binding process. In my DB the boolean filed to not allow Null entry for this boolean. If I remove the check box All work good. No problem in edit mode, only in insert.

Thanks for your help
0
Konstantin Petkov
Telerik team
answered on 10 Apr 2008, 12:16 PM
Hi Pierre,

You have assigned the event handlers in the .aspx and also through the Handles clause. Please, remove one of those for all the control events.

As to the CheckBox binding issue, the checkbox resides in ItemTemplate of TemplateColumn, isn't it? Take a look for example at the CheckBoxColumn/TemplateColumn with CheckBox comparison here:

http://www.telerik.com/help/radcontrols/prometheus-futures/grdColumnTypes.html#Similarities_Differences_Checkbox

I hope it helps.

All the best,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Pierre
Top achievements
Rank 2
Iron
Iron
answered on 10 Apr 2008, 12:40 PM
Ok Thanks for the duplicate event! You are right... my fault!

FOr the 2 other question I will send a support request. Thanks
Tags
Grid
Asked by
Pierre
Top achievements
Rank 2
Iron
Iron
Answers by
Konstantin Petkov
Telerik team
Pierre
Top achievements
Rank 2
Iron
Iron
Share this question
or