Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
230 views
Hi,

I have a RadGrid with a custom FormTemplate in the EditFormSettings and AutoGenerateEditColumn = "true".  On the RadGrid ItemDataBound, I successfully bind to the controls in my Edit Form.  This is done as follows:

protected void myRadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode) //bind edit form controls
            {
                int pkId = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["MyPkID"].ToString());
                GridEditFormItem editFormItem = e.Item as GridEditFormItem;
                TextBox tb = editFormItem.FindControl("MyTextBox");
                tb.Text = "my text";
            }
        }

The edit form shows and is correctly populated with data.  The problem is, the 'Edit' link on the RadGrid row does not change to show the 'Update' and 'Cancel' links, so the row cannot be updated.  You can see, though, that e.Item.IsInEditMode is true, so why does the RadGrid not think the row is in Edit mode?   What am I missing?

Princy
Top achievements
Rank 2
 answered on 15 Nov 2011
1 answer
112 views
Hello,

I'm using in my websites the RadGrid control alot (See the following code - only DataKeyNames, AddNewRecordText properties and the columns are different).
Can I save this template on an external file and load it in each time I want to use the control?
<telerik:RadGrid ID="MngRadGrid" runat="server" GridLines="None" AllowPaging="True" CssClass="RadGrid" OnItemDataBound="MngRadGrid_ItemDataBound"
                AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true" OnPreRender="MngRadGrid_PreRender"
                OnNeedDataSource="MngRadGrid_NeedDataSource" OnUpdateCommand="MngRadGrid_UpdateCommand"
                OnInsertCommand="MngRadGrid_InsertCommand" OnDeleteCommand="MngRadGrid_DeleteCommand" Width="780px">
            <MasterTableView Width="780px" CommandItemDisplay="Top" Dir="LTR" DataKeyNames="UserID">
            <AlternatingItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
            <CommandItemSettings RefreshText="Refresh" AddNewRecordText="Add New Record" />
            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
            <HeaderStyle HorizontalAlign="Left" />
            <Columns>
                <telerik:GridEditCommandColumn EditText="<%$ Resources:TelerikResource, RadGridEditColumnText %>" ItemStyle-Width="7%" UniqueName="EditCommandColumn1" >
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn UniqueName="UserID" HeaderText="User ID" ItemStyle-Width="7%" DataField="UserID">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="UserName" HeaderText="<%$ Resources:MngResource, MngRLUsersMngRadGridColumnsUserName %>" ItemStyle-Width="19%" >
                  <ItemTemplate>
                      <asp:Image ID="AvatarImage" ImageUrl='<%# "~/RL/Avatars/" + Eval("Avtr") %>' Width="40px" Height="40px" runat="server" /><br />
                      <asp:Label ID="ManagerNameDataLabel" SkinID="NormalText" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                  </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="RolesNam" HeaderText="<%$ Resources:MngResource, MngRLUsersMngRadGridColumnsRoles %>" ItemStyle-Width="7%" >
                  <ItemTemplate>
                      <asp:Label ID="RolesDataLabel" SkinID="NormalText" runat="server" Text="..." ToolTip='<%# Eval("RolesNam") %>'></asp:Label>
                  </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="Email" HeaderText="<%$ Resources:MngResource, MngRLUsersMngRadGridColumnsEmail %>" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left" DataField="Email">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="LastEdit" HeaderText="Last Edit" ItemStyle-Width="26%" >
                  <ItemTemplate>
                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                         <tr valign="top">
                           <td width="25">
                              <asp:Label ID="ByLabel" runat="server" SkinID="FieldNameLabel" Text="By:"></asp:Label>
                           </td>
                           <td width="*">
                              <asp:Label ID="LastEditedByNameDataLabel" SkinID="NormalText" runat="server" Text='<%# Eval("LastEditedByName") %>'></asp:Label>
                           </td>
                         </tr>
                         <tr>
                            <td width="25">
                              <asp:Label ID="DateLabel" runat="server" SkinID="FieldNameLabel" Text="Date:"></asp:Label>
                           </td>
                           <td width="*">
                              <asp:Label ID="DateDataLabel" runat="server" Text='<%# Eval("LastEditedDate") %>'></asp:Label>
                           </td>
                         </tr>
                      </table>
                  </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn ConfirmText="<%$ Resources:TelerikResource, RadGridDeleteColumnConfirmText %>" ConfirmDialogType="RadWindow" ItemStyle-Width="7%"
                    ConfirmTitle="<%$ Resources:TelerikResource, RadGridDeleteColumnConfirmTitle %>" ButtonType="ImageButton" CommandName="Delete" Text="<%$ Resources:TelerikResource, RadGridDeleteColumnText %>"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings UserControlName="SubUserControl.ascx" EditFormType="WebUserControl">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>

If it is possible, let me know how can I do that

Regards,
Bader
Mira
Telerik team
 answered on 15 Nov 2011
2 answers
387 views
Hi,
Using RadFileExplorer, I want the user to be able to create new subfolders. However, I want to limit this ability to certain existing folders.
Example: The user may create subfolders in folder "Pictures", but not in folder "Agreement".
I can use the server-side OnItemCommand event and cancel the operation if RadFileExplorerEventArgs.Command=="CreateDirectory" and RadFileExplorerEventArgs.Path is not a folder that allows subfolders, but at this point the user has already entered the name of the new folder and pressed OK.
The best solution,  I think, would be to disable the Create folder button (and context-menu choice) client-side, depending on which folder is the current folder. Something like this (for the toolbar button):

 

<telerik:RadFileExplorer OnClientFolderChange="OnClientFolderChange" EnableCreateNewFolder="True"....

Javascript:

function OnClientFolderChange(sender, args) {
    if(args.get_path() != 
"Pictures") {
        var tbitem = 
sender.get_toolbar().findItemByValue("NewFolder");
        
if(tbitem != 
null{
            tbitem.disable();
        }
    }
}

Unfortunately, this does not work. The toolbar button gets disabled, but then enabled again, immediately after.

In addition, this would be solved very easily if the EnableCreateNewFolder property of RadFileExplorer could be set client-side, using javascript. Is that possible, or do you guys have a different solution?

Thanks,

Arnstein

Dobromir
Telerik team
 answered on 15 Nov 2011
5 answers
157 views
  Dear telerik,
   
     I use a radfilter for filter the RadGrid. Now I save the value of radfilter SaveSettings function.I need load the setting when pageload.
     any idea? thanks!
James Campbell
Top achievements
Rank 1
 answered on 15 Nov 2011
2 answers
250 views
Seems like this should be simple, but I'm not seeing it.
I have a RadListView displaying data from a table and I have LinkButtons on each item to delete them. Everything fires like I would expect but I'm having trouble in my ItemCommand event.

In my ItemCommand event I just need to be able to access my "pri_key" column of the bound table.
I'm used to doing something like e.Item.DataItem("pri_key") in other bound controls but I don't see anything like that.
How should I be accessing this? Thanks!

Thanks!
Sebastian
Telerik team
 answered on 15 Nov 2011
6 answers
1.0K+ views
Hi,

AllowColumnResize

 

 

="True" in the rad gird. This allows resizing the columns to any width. I want to set a minimum value to which the column width can be reduced. if the user tries to reduce the width of the column lower than what is specified , then the width should be set to the minimum value mentioned.

Kindly let us know if this can be achieved and how.

Thanks,
Sudha.

Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Nov 2011
3 answers
75 views
I have hierarchical Grid .If i Dont have Childs Then it should Not show expand Button.How to do That.
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Nov 2011
3 answers
193 views
Hi telerik team,

Is any possible to Remove/Hide the "Remove Element" in the Node inspector.

For E.g

div>ul>li>Remove ELement

Instead of we need only

div>ul>li

Rumen
Telerik team
 answered on 15 Nov 2011
1 answer
94 views
I want to access label field in itemtemplate and change the text at run time when in edit mode.
Andrey
Telerik team
 answered on 15 Nov 2011
1 answer
179 views
I am using your 'rating & comment' example as the starting blocks for a ratings system I am building but I have hit a snag when using inside a repeater.

Line 13:        function OnClientRated(controlRating, args) {
Line 14:             var tooltip = $find("<%= RadToolTip1.ClientID %>");
Line 15:             tooltip.show();
Line 16:         }

My browser is telling me it cant find 'RadToolTip1' as it is within a repeater. How do I fix this? What do I need to change on the JS so it can see the radtooltip?

Also, how do I get the values of the RadRating control (RadRating1) from within a repeater? Can I use OnItemCommand and pass in arguments and commnds???

Many thanks
Simon
Slav
Telerik team
 answered on 15 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?