Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
146 views
I have used textbox,label in all GridTemplateColumn's EditItemTemplate. I am unable to get the id of those controls when trying it in jquery.
I tried this method too.

var grid = $find("<%=Grid1.ClientID %>");
var masterTable = grid.get_masterTableView();
var row = masterTable.get_dataItems();
var button = row.findElement("controlname");

But I couldn't get the ID.

If the Grid is in ICGRadAjaxManager's updated control, will the above code work?

Thanks in advance

Vijay.
Shinu
Top achievements
Rank 2
 answered on 03 May 2012
1 answer
80 views
I find that in the raddatepicker if you manually type in the date and try to access what is in the object I get 01/01/0001 instead of what was typed in. Is there some setting to set to manual typing is allowed?
Richard
Top achievements
Rank 1
 answered on 02 May 2012
1 answer
59 views
Hi All,

In radgrid if I click on edit link it has to open a new window in browser (as per browser settings it may be new window or new tab in current browser window) edit page, and new page has to load my user control. What settings need to be done in UI....

Thanks & Regards,
Ramesh Sambari
Richard
Top achievements
Rank 1
 answered on 02 May 2012
0 answers
75 views
The scenario is that a user may be on page 4, clicks a link, decides it is the wrong link, then hits the backbutton. The sorted list and page should be maintained. I've tried enabling viewstate, and even storing the page index into the session and having it load on prerender (if not null). What is happening is that when I hit the back button, I get an error stating that the page has expired. What is the normal practice for obtaining this effect and are there any suggestions as to why the page is expiring, preventing my ability to use the back button?
Jeremy
Top achievements
Rank 1
 asked on 02 May 2012
2 answers
77 views
One of my menu items serves as a login/logout button. I need to change the text of this menu item based on if they are logged in or out. I noticed there are no individual id's on each of the menu items. How do I get at the menu item without using ordinal positions or writing traversing code? Thanks guys!
Darren
Top achievements
Rank 2
 answered on 02 May 2012
2 answers
127 views
Hello, I have a radEditor which is located within the content template of a radWindow. This radWindow is displayed to a user using the radWindow's VisibleOnPageLoad property (server side). I've added a handler for the OnClientShow event of the radWindow and in it I call the editor's onParentNodeChanged method. Everything works as expected in IE and FF. Chrome users, however, get the window and the editor but are unable to type anything in the content area. I can click the buttons in the toolbar cannot type in the content area. I went ahead and enabled the HTML edit mode and when I chose this mode I was able to type in the content area but when I switched back to the Design mode (default) there was no text in the content area. I'm not sure what I'm missing? I am on the latest build of Telerik. Thanks.
Hunter
Top achievements
Rank 1
 answered on 02 May 2012
1 answer
459 views
Hello,

We couldn't fire our Insert/Update command int the RadGrid when editing the row.
We have tried almost every solutions given on this forum without success.

Some information about our code situation :
 - The code is in a Web Controls (details.ascx)
 - We have disabled Ajax
 - The code is in a RadPageView, that is in an UpdatePanel
 
 The code from ASP.NET
<telerik:RadGrid ID="__linksRadGrid" runat="server"
        AllowMultiRowEdit="false"
        ShowStatusBar="true"
        GridLines="None"
        AllowPaging="False"  
        AllowAutomaticUpdates="false"
        AllowAutomaticInserts="false"
        OnNeedDataSource="LinksRadGrid_NeedDataSource"                      
        OnInsertCommand="LinksRadGrid_InsertCommand"
        OnUpdateCommand="LinksRadGrid_UpdateCommand"
        OnDeleteCommand="LinksRadGrid_DeleteCommand"
        OnItemDataBound="LinksRadGrid_ItemDataBound"
        OnItemCommand="LinksRadGrid_ItemCommand"
        AllowSorting="true"
        Skin="Transparent"
        Width="450px">
    <MasterTableView AutoGenerateColumns="False"
            DataKeyNames="IdAttachment"
            CommandItemDisplay="Bottom" >
        <PagerStyle Mode="NextPrevAndNumeric" />
        <CommandItemTemplate>
            <div style="padding: 5px 5px;">
                <asp:ImageButton ID="imgInsert" runat="server"
                        ImageUrl="~/App_Themes/Default/Images/Icons/add2.gif"
                        CommandName="InitInsert"
                        AlternateText="Insert New Record"                
                        ToolTip = "Insert New Record" />
                  
                <asp:ImageButton ID="imgRefresh" runat="server"
                        ImageUrl="~/App_Themes/Default/Images/Icons/refresh.png"
                        CommandName="RebindGrid"
                        AlternateText="Refresh the grid"                
                        ToolTip = "Refresh the grid" />
            </div>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
 
            <telerik:GridBoundColumn DataField="Title"
                    DataType="System.String"
                    HeaderText="Title"
                    SortExpression="Title"
                    UniqueName="Title">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description"
                    DataType="System.String"
                    HeaderText="Description"
                    SortExpression="Description"
                    UniqueName="Description">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AttachmentType"
                    DataType="System.String"
                    HeaderText="AttachmentType"
                    SortExpression="AttachmentType"
                    UniqueName="AttachmentType"
                    Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Url"
                    DataType="System.String"
                    HeaderText="Url"
                    SortExpression="Url"
                    UniqueName="URL"
                    Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn 
                    HeaderText="Type" 
                    UniqueName="Type">
                <ItemTemplate>
                    <asp:ImageButton ID="__attachedTypeImageButton" runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton"
                    ConfirmText="Delete this record?"
                    ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" />
 
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
            <FormTemplate>
                <table cellspacing="2" cellpadding="1" width="100%" border="0">
                    <tr>
                        <td>
                            <asp:Label ID="__titleLabel" runat="server"
                                    Text="Title">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="_titleTextBox" runat="server"
                                    Width="100px"
                                    Text='<%# Bind("Title") %>' >
                            </asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="__decriptionLabel" runat="server"
                                    Text="Description">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="__decriptionTextBox" runat="server"
                                    Width="100px"
                                    TextMode="MultiLine"
                                    Rows="4"
                                    Text='<%# Bind("Description") %>'>
                            </asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="__URLLabel" runat="server"
                                    Text="URL">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="__urlTextBox" runat="server"
                                    Width="255px"
                                    Text='<%# Bind("URL") %>' >
                            </asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="__orLabel" runat="server"
                                    Text="or">
                            </asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="__fileUploadLabel" runat="server"
                                    Text="File">
                            </asp:Label>
                        </td>
                        <td>
                            <asp:FileUpload ID="__fileUpload" runat="server" />
                        </td>
                    </tr>
                    <tr>
                         <td align="right" colspan="2">
                            <asp:Button ID="btnUpdate" runat="server"
                                    Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                    CausesValidation="True" >
                            </asp:Button
                              
                            <asp:Button  ID="btnCancel" runat="server"
                                    Text="Cancel"
                                    CausesValidation="False"
                                    CommandName="Cancel">
                            </asp:Button >
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

The C# code of code-behind
protected void LinksRadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
     
    List<Attachment> attachmentList = AttachmentBLL.GetByIdDocument(this.IdDocument);
    DataTable dt = this.ToDataTable<Attachment>(attachmentList);
 
    __linksRadGrid.DataSource = dt;
}
 
protected void LinksRadGrid_ItemDataBound(object sender, GridItemEventArgs e) {
 
    if (e.Item is GridDataItem) {
        GridDataItem gridDataItem = (GridDataItem)e.Item;        
 
        int attachedType = int.Parse(gridDataItem["AttachmentType"].Text);
        ImageButton image = (ImageButton)gridDataItem["Type"].FindControl("__attachedTypeImageButton");
         
        if (attachedType == 4
                && !string.IsNullOrEmpty(gridDataItem["URL"].Text)) {
 
            image.ImageUrl = "~/App_Themes/Default/Images/Icons/web.png";
            image.OnClientClick = this.WindowsOpenPopup(gridDataItem["URL"].Text);
        }
        else if (attachedType == 5) { // Type document
                         
            int idAttachment = int.Parse(gridDataItem["IdAttachment"].Text);
                             
            image.ImageUrl = "~/App_Themes/Default/Images/Icons/pdf16.png";
            image.OnClientClick = this.GetAttachmentLinksUrl(idAttachment);
        }
        else {
 
            this.ShowImageError(image, "Error : wrong data error! Please correct your data.");               
        }
    }
}
 
 
protected void LinksRadGrid_ItemCommand(object source, GridCommandEventArgs e) {
 
    if (e.CommandName == "Update" && e.Item is GridEditFormItem) {
        GridEditFormItem editFormItem = (GridEditFormItem)e.Item;
    }
}
 
protected void LinksRadGridUpdate_Click(object sender, EventArgs e) {
 
    if (IsPostBack) {
 
    }
 
}
 
protected void LinksRadGrid_InsertCommand(object sender, GridCommandEventArgs e) {
 
    GridEditableItem editedItem = e.Item as GridEditableItem;
}
 
protected void LinksRadGrid_UpdateCommand(object sender, GridCommandEventArgs e) {
 
    if (e.CommandName == RadGrid.UpdateCommandName) {
        if (e.Item is GridEditFormItem) {
            GridEditFormItem item = (GridEditFormItem)e.Item;
        }
    }
}
protected void LinksRadGrid_DeleteCommand(object sender, GridCommandEventArgs e) {
 
    GridEditableItem editedItem = e.Item as GridEditableItem;
}
 



Thank for your help



LevizBB
Top achievements
Rank 1
 answered on 02 May 2012
2 answers
198 views
I've created two radio buttons

<telerik:RadButton ID="rbOption1" runat="server" Text="option 1" ToggleType="Radio"
    GroupName="group1" ButtonType="ToggleButton" />
<br />
<telerik:RadButton ID="rbOption2" runat="server" ToggleType="Radio"
    GroupName="group1" ButtonType="ToggleButton">
    <ContentTemplate>
        <asp:Label ID="lblChoose" runat="server" Text="choose" />
        <asp:DropDownList ID="ddlChoose" runat="server" />
    </ContentTemplate>
</telerik:RadButton>

I want the second radbutton to be rendered with a radio button just the the first radbutton. But instead the entire contents of the content template is being rendered as an html anchor. Is there a way to use the radbutton to look like my attached mockup?
Brian
Top achievements
Rank 1
 answered on 02 May 2012
5 answers
349 views
I have a question, how i can Get the value of a Cell in a RadGrid and pass it to a RadTextBox using the Client Event "OnRowSelected"??

thanks.
Joswhar
Top achievements
Rank 2
 answered on 02 May 2012
1 answer
79 views
Hi,

I have a scenario that I'm hoping someone here can provide guidance on...

I have a RadGrid programmed so that when a row is selected it populates a user control elsewhere on the page and the row in the grid is highlighted as selected. If a user has entered or changed information for that item in the user control and then tries to select another row without saving, I've used javascript to remind them to save. If they select OK, it ignores the changes and loads the new item from the newly selected row. If they select Cancel, it prevents the page from posting.

I've first used the OnRowClick ClientEvent, and it would work as I expected, but the newly selected row would still be shown as "selected" even if I canceled the postback. I then tried the OnClientSelecting ClientEvent and it prevented the newly selected row from displaying as "selected", but the current row still lost it's "selected" row styling. What event should I use to prevent the currently selected row from losing its highlighted "selected" styling in the grid if the user selects "Cancel"?

Thanks for any help!

Smith
Martin
Telerik team
 answered on 02 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?