Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
160 views
Hi All,
I am facing an issue with radgrid. I have 2 radgrid in one of my page. The first grid will have only one row every time and only edit is enabled there. In the second grid I will have multiple rows and there add, edit and delete also will be possible. We are not using inline edit functionality of radgrid instead we are using the asp button to edit the details( the page will be redirected to another page with the row details; I know it is unorthodox way but our client wants like this). So I have following requirements.

1) If the user clicks on first grid only edit button should be enabled.
2) If the user clicks on second grid both edit and delete button has to enabled.
3) We should allow the user to select only one row at a time either from first grid or second grid.

We achieved this functioanlity by overriding some of the radgrid's script, but I need to know whether there is any other solution for achieving this without overriding.

PS: We need to implement this functionality in client side.

Thanks in advance,
Vinod.
Tsvetoslav
Telerik team
 answered on 07 Oct 2009
1 answer
78 views
Hello
I have a radgrid which I can add user in the detail table. In that edit form I have a dropdownlist. On a specific selected value I would like to put a default value in the next textbox.
Here is my radgrid.
 <telerik:RadGrid   
        ID="RadGrid1"   
        runat="server" 
        DataSourceID="SQLETAB" 
        Skin="Office2007"   
        GridLines="None" 
        autogeneratecolumns="false" 
        AllowAutomaticInserts="true"   
        AllowAutomaticUpdates="True"   
        AllowAutomaticDeletes="true" 
        HorizontalAlign=left 
         EditFormSettings-FormmaintableStyle-HorizontalAlign=Left 
         Width="98%" 
        > 
          
        <PagerStyle   
            NextPageText="Suivant" PrevPageText="Précédent" Mode="NextPrevAndNumeric"   
            NextPagesToolTip="Pages suivante"   
            NextPageToolTip="Page suivante"   
            PrevPagesToolTip="Pages précédente"   
            PrevPageToolTip="Page précédente"/>  
                 <HierarchySettings ExpandTooltip="Voir les usagers pour votre Ã©tablissement" CollapseTooltip ="Revenir Ã  votre Ã©tablissement" /> 
        <MasterTableView   
            Name="MTVUsager" 
            AllowAutomaticInserts=true 
            AllowAutomaticDeletes=true 
            AllowAutomaticUpdates=true 
            DataSourceID="SQLETAB" 
            DataKeyNames="NO_ETAB" 
            CommandItemSettings-AddNewRecordText="Ajouter un Ã©tablissement"   
            CommandItemSettings-RefreshText="Rafraichir" 
            EditFormSettings-EditColumn-CancelText="Annuler"   
            EditFormSettings-EditColumn-EditText="Modifier" 
            EditFormSettings-EditColumn-UpdateText="Mise Ã  jour" 
            HorizontalAlign=Left 
            CommandItemDisplay=Top 
            EditFormSettings-FormMainTableStyle-HorizontalAlign=Left 
            EditFormSettings-FormTableItemStyle-HorizontalAlign=Left 
             EditFormSettings-FormTableAlternatingItemStyle-HorizontalAlign=Left>      
                             
              
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
                 
            <Columns> 
              
                <telerik:GridBoundColumn   
                    SortExpression="TYPE_ECOLE"   
                    HeaderText="TYPE_ECOLE"   
                    DataField="TYPE_ECOLE"   
                    UniqueName="TYPE_ECOLE1"   
                    visible="false" 
                    readonly="true">  
                </telerik:GridBoundColumn> 
      
                      
                <telerik:GridBoundColumn   
                    SortExpression="NO_ORG"   
                    HeaderText="NO_ORG"   
                    DataField="NO_ORG"   
                    UniqueName="NO_ORG" Visible=false ReadOnly=true>  
                    <ItemStyle HorizontalAlign=Left /> 
                </telerik:GridBoundColumn> 
                  
                <telerik:GridEditCommandColumn   
                    ButtonType="ImageButton"   
                    UniqueName="EditCommandColumn" EditText="Modifier" > 
                </telerik:GridEditCommandColumn> 
                   
                 <telerik:GridButtonColumn   
                    ConfirmText="Supprimer cet Ã©tablissement?"   
                    ConfirmDialogType="RadWindow"   
                    ConfirmTitle="Supprimer"   
                    ButtonType="ImageButton" 
                    CommandName="Delete"   
                    Text="Supprimer"   
                    UniqueName="DeleteColumnEtab">  
                    <ItemStyle HorizontalAlign="Center"  /> 
                 </telerik:GridButtonColumn> 
                           
                <telerik:GridBoundColumn   
                    SortExpression="SIGLE"   
                    HeaderText="Unité administrative"   
                    DataField="SIGLE"   
                    UniqueName="SIGLE">  
                    <ItemStyle HorizontalAlign=Left /> 
                </telerik:GridBoundColumn> 
                  
                <telerik:GridBoundColumn   
                    SortExpression="DESCR"   
                    HeaderText="Nom de l'établissement"   
                    DataField="DESCR"   
                    UniqueName="DESCR">  
                    <ItemStyle HorizontalAlign=Left /> 
                </telerik:GridBoundColumn> 
            </Columns> 
            <DetailTables> 
                <telerik:GridTableView   
                    Name="DTVUSAGER" 
                    DataSourceID="SqlUSAGER" 
                    DataKeyNames="NO_IDENT" 
                    AllowAutomaticDeletes="True" 
                    AllowAutomaticInserts="true" 
                    AllowAutomaticUpdates="True" 
                    CommandItemDisplay="Bottom" 
                    CommandItemSettings-AddNewRecordText="Ajouter un usager"   
                    CommandItemSettings-RefreshText="Rafraichir"   
                    EditFormSettings-EditColumn-CancelText="Annuler"   
                    EditFormSettings-EditColumn-InsertText="Ajouter"   
                    EditFormSettings-EditColumn-EditText="Modifier"   
                    EditFormSettings-EditColumn-UpdateText="Mise Ã  jour"   
                     EditFormSettings-EditColumn-HeaderButtonType="PushButton" 
                          
                    NoDetailRecordsText="Il n'y a aucun usager pour cet Ã©tablissement."   
                    EditMode="EditForms" > 
                      
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px" /> 
                    </ExpandCollapseColumn> 
                  
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="NO_ETAB" MasterKeyField="NO_ETAB" /> 
                    </ParentTableRelation> 
                      
                    <Columns> 
                      
                         <telerik:GridTemplateColumn UniqueName="Template3" HeaderText="Confirmer">  
                            <ItemTemplate> 
                                <asp:LinkButton ID="LlGenererMotDepasse" CommandName="RegenererMotPasse" runat="server">Regénérer mot de passe</asp:LinkButton>      
                            </ItemTemplate>   
                         </telerik:GridTemplateColumn> 
                  
                         <telerik:GridEditCommandColumn   
                            ButtonType="ImageButton"   
                            UniqueName="EditCommandColumn"   
                            EditText="Modifier">  
                         </telerik:GridEditCommandColumn> 
                           
                         <telerik:GridButtonColumn   
                            ConfirmText="Supprimer cet usager?"   
                            ConfirmDialogType="RadWindow"   
                            ConfirmTitle="Supprimer"   
                            ButtonType="ImageButton" 
                            CommandName="Delete"   
                            Text="Supprimer"   
                            UniqueName="DeleteColumnDomaine">  
                            <ItemStyle HorizontalAlign="Center"  /> 
                         </telerik:GridButtonColumn> 
                      
                     <telerik:GridBoundColumn   
                            SortExpression="NO_IDENT"   
                            HeaderText="NO_IDENT"   
                            DataField="NO_IDENT"   
                            UniqueName="NO_IDENT"   
                            ReadOnly=true   
                            Visible=false>  
                        </telerik:GridBoundColumn> 
                          
                        <telerik:GridBoundColumn   
                            SortExpression="NOM"   
                            HeaderText="Nom"   
                            DataField="NOM"   
                            UniqueName="NOM">  
                        </telerik:GridBoundColumn> 
                          
                        <telerik:GridBoundColumn   
                            SortExpression="CODE_COURRIEL"   
                            HeaderText="Code de courriel"   
                            DataField="CODE_COURRIEL"   
                            UniqueName="CODE_COURRIEL">  
                        </telerik:GridBoundColumn> 
                          
                         <telerik:GridBoundColumn   
                            SortExpression="COURRIEL"   
                            HeaderText="Courriel"   
                            DataField="COURRIEL"   
                            UniqueName="COURRIEL">  
                        </telerik:GridBoundColumn> 
                          
                         
                                                
                        <telerik:GridDropDownColumn   
                            DataSourceID="XmlDSType" 
                            ListTextField="Text"   
                            ListValueField="Value" 
                            UniqueName="Type" 
                            SortExpression="Type" 
                            HeaderText="Type"   
                            DropDownControlType="RadComboBox" 
                            DataField="TYPE">  
                        </telerik:GridDropDownColumn> 
                          
                         <telerik:GridBoundColumn   
                            SortExpression="PANIER_MAX"   
                            HeaderText="Panier max"   
                            DataField="PANIER_MAX"   
                            UniqueName="PANIER_MAX">  
                        </telerik:GridBoundColumn> 
                           
                        <telerik:GridTemplateColumn EditFormHeaderTextFormat=" " HeaderText="d!" Visible=false>  
                            <EditItemTemplate> 
                                <asp:Label ID="Label1" runat=server visible=true Text="Le mot de passe de l'usager sera générer automatiquement lors d'un ajout. Celui-ci sera envoyé Ã  la personne concerné par courriel."></asp:Label> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                          
                    </Columns> 
                </telerik:GridTableView> 
            </DetailTables> 
        </MasterTableView> 
    </telerik:RadGrid> 
Yavor
Telerik team
 answered on 07 Oct 2009
1 answer
124 views
On ItemDataBound of the mastertable I am hiding the delete and edit columns for certains rows.
This part is working perfectly, except for when the detailtable is displayed. When the detailtable is displayed it rebinds the whole grid but does not call ItemDataBound for the mastertable so the delete and edit columns are displayed again.

protected void grdEvents_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) 
            { 
                GridDataItem item = (GridDataItem)e.Item; 
                if (e.Item.OwnerTableView.Name == "EventsGrid")//This is the mastertable 
                { 
                    ProtocolRegimenEvent preItem = (ProtocolRegimenEvent)e.Item.DataItem; 
                    TableCell td = item[grdEvents.Columns.FindByUniqueNameSafe("colDelete")]; 
 
                    if (preItem.EventTypeId != (int)Enums.EventTypes.Scheduled) 
                    { 
                        if (td != null && td.Controls.Count > 0) 
                        { 
                            td.Controls.RemoveAt(0); 
                            Label lbl = new Label(); 
                            lbl.Text = "-"; 
                            td.Controls.Add(lbl); 
                        } 
                        if (preItem.EventTypeId == (int)Enums.EventTypes.Unscheduled) 
                        { 
                            td = item[grdEvents.Columns.FindByUniqueNameSafe("colEdit")]; 
                            if (td != null && td.Controls.Count > 0) 
                            { 
                                td.Controls.RemoveAt(0); 
                                Label lbl = new Label(); 
                                lbl.Text = "-"; 
                                td.Controls.Add(lbl); 
                            } 
                        } 
                    } 
                } 
                else //This is a detailtable 
                { 
                     ProtocolRegimenEventForm preItem = (ProtocolRegimenEventForm)e.Item.DataItem;

                    TableCell td = e.Item.OwnerTableView.ParentItem[grdEvents.Columns.FindByUniqueNameSafe("colDelete")];

                    if (preItem.EventTypeId != (int)Enums.EventTypes.Scheduled)
                    { //remove buttons
}
                } 
            } 
        } 

I can remove the edit and delete buttons for the parentItem but not any of the other rows. How do I remove it from the other rows?


Yavor
Telerik team
 answered on 07 Oct 2009
1 answer
65 views
I am using a Menu control in conjunction with Splitbar. I used position:absolute in order to get the menu to display on top of the splitbar. However, now the child menu does not display with its offset, it displays on top of the parent menu. Is there a fix for this?
Paul
Telerik team
 answered on 07 Oct 2009
3 answers
108 views
hi,

i am applying css class to radgrid dynamically using .cssClass property. it works fine for all the postbacks. but if i reorder the column then page gets post back but css class does not get applied to grid. Please help me.
Dimo
Telerik team
 answered on 07 Oct 2009
1 answer
148 views
Hi,
I understood that we can not add specialdays at client side..
but if i add the specialdays at server side and want to clear on client side on a button click.
can i do that?
please give me any sample code
-Krishna
Sebastian
Telerik team
 answered on 07 Oct 2009
1 answer
191 views
I've populated a GridTemplateColumn with a RadComboBox.  When an option in the combobox is selected, I'm catching the OnClientSelectedIndexChanged event.  I need to know which row this has occurred in, on the client-side.  I can get the actual combobox control and the grid control using the 'sender' parameter, but I can't figure out how to get the row object so that I can get some other data out of another column in that row.

Again, I want to do all of this client-side.

Thanks!
Princy
Top achievements
Rank 2
 answered on 07 Oct 2009
1 answer
85 views
When i wantto filter records on RadGrid, it throws the error : 

Microsoft JScript worktime error: Sys.WebForms.PageRequestManagerServerErrorException: No property or field 'AFieldName' exists in type 'EntityBase2'

I use a LLBLGEN datasource for my RadGrid.

What could cause that error?
Thanks...
Kem Arda
Top achievements
Rank 1
 answered on 07 Oct 2009
1 answer
150 views

Hi, is it somehow possible to wrap the RadEditor in a custom webpart, using it as a regular UI control? I have tried using the Telerik.SharePoint.RadHtmlField  as

public class MyWebPart : WebPart, IWebEditable

{

…

  protected override void CreateChildControls()

  {

    RadHtmlField   uiEditor = new RadHtmlField();

    uiEditor.Content = EditorText; \\public property

    Controls.Add(uiEditor);

…

But I get an Exception:

The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

What can I do?

Stanimir
Telerik team
 answered on 07 Oct 2009
1 answer
99 views
Hello all,

I am newbie in Telerik tool. How can i use this in SharePoint(only in WSS3.0 not in MOSS )?

Please help me, it really confusing me means from where i start? Are those components are related to silverlight? Need to download silverlight or silverlight  tool for Visual studio for developement?
I want to create dashboard with telerik component.
any help will be appreciated.

Thank you,
N i T i N
Stanimir
Telerik team
 answered on 07 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?