Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
306 views
How do I add a onclick handler to my DocumentManager control? I can alter the href or URL property from a ExtendedFileProvider to add "javascript:clickHandler()". But this isn't good practice.

I have both a LinkManager and a DocumentManager. How do I add an onClick to the <a> tags that get generated by these controls?

Thank you!
Ianko
Telerik team
 answered on 16 Feb 2015
2 answers
106 views
I am getting an error:
'ddlWebPages' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value


This happens only when I click the Add New Record button on the grid. the ddlWebPages has no issues when I am in edit mode.
I believe this has to do the the snippet SelectedValue='<%# Bind("security_webpage_id") %> of the dropdownlist. 
I searched for solutions but none of them worked. There was one suggestion for SelectedValue='<%# Eval("security_webpage_id") == null ? null :  Eval("security_webpage_id") %>'. That didnt work for me. Has anyone dealt with this issue? HELP! I am so close to finishing my grid.



<telerik:RadGrid ID="RadGridwebpagemanagement" CssClass="webpageManagementGrid" MasterTableView-DataKeyNames="ID" runat="server"
            AllowFilteringByColumn="True" AllowSorting="True"
            GroupPanelPosition="Top" 
            OnNeedDataSource="RadGridwebpagemanagement_NeedDataSource"
            OnUpdateCommand="RadGridwebpagemanagement_UpdateCommand" OnItemDataBound="RadGridwebpagemanagement_ItemDataBound" OnDeleteCommand="RadGridwebpagemanagement_DeleteCommand" OnInsertCommand="RadGridwebpagemanagement_InsertCommand">
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New Webpage" 
                 InsertItemPageIndexAction="ShowItemOnCurrentPage">
 
                <columns>
                     
                    <telerik:GridBoundColumn DataField="webpage_name" HeaderText="Web Page" UniqueName="webpage_name" ItemStyle-Font-Names="Arial" ItemStyle-Font-Bold="true"
                                FilterControlWidth="200px">
                                <HeaderStyle Width="230px" Font-Names="Arial" />
                                <ItemStyle Width="230px" />
                    </telerik:GridBoundColumn>
                    
                    <telerik:GridCheckBoxColumn DataField="add_privledge" HeaderText="Allow Adds" UniqueName="add_privledge"
                                FilterControlWidth="120px">               
                                <HeaderStyle Width="120px" Font-Names="Arial" />
                                <ItemStyle Width="120px" />
                    </telerik:GridCheckBoxColumn>
                     
                    <telerik:GridCheckBoxColumn DataField="edit_privledge" HeaderText="Allow Edits" UniqueName="edit_privledge"
                                FilterControlWidth="120px">               
                                <HeaderStyle Width="120px" Font-Names="Arial" />
                                <ItemStyle Width="120px" />
                   </telerik:GridCheckBoxColumn>
 
                     <telerik:GridCheckBoxColumn DataField="delete_privledge" HeaderText="Allow Deletes" UniqueName="delete_privledge"
                              FilterControlWidth="120px">               
                                <HeaderStyle Width="120px" Font-Names="Arial" />
                                <ItemStyle Width="120px" />
                    </telerik:GridCheckBoxColumn>                  
 
                   <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit" CancelText="Cancel" ItemStyle-Width="50px" HeaderStyle-Width="50px" FilterControlWidth="50px" />
                   <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="LinkButton" Text="Delete" CommandName="Delete" ItemStyle-Width="50px" HeaderStyle-Width="50px" FilterControlWidth="50px" />
                     
                </columns>
                
                <EditFormSettings EditFormType="Template">
                <FormTemplate>   
                    
                   
                    <div id="divGridEdit" class="divGrid">
                            <b>Add New Role to Webpage Association</b>
                            <br /><br />
                            <table>
 
                                <tr>
                                    <td><asp:Label Text="Web Page:" runat="server"></asp:Label></td>
                                    <td>
                                         <asp:DropDownList ID="ddlWebPages"  DataSourceID="sqlDataSourceWebpages" AppendDataBoundItems="True"
                                                DataTextField="webpage_name" DataValueField="ID" SelectedValue='<%# Bind("security_webpage_id") %>'
                                                runat="server"> 
                                          
                                         </asp:DropDownList>
 
                                    </td>
                                </tr>
                                <tr>
                                     <td><asp:Label Text="Allow Add:" runat="server"></asp:Label></td>
                                     <td><asp:CheckBox ID="chkboxAllowAdd" Checked='<%# Bind("add_privledge") %>' runat="server" /></td>
                                </tr>
                                <tr>
                                     <td><asp:Label Text="Allow Edit:" runat="server"></asp:Label></td>
                                     <td><asp:CheckBox ID="chkboxAllowEdit" Checked='<%# Bind("edit_privledge") %>' runat="server" /></td>
                                </tr>
                                <tr>
                                     <td><asp:Label Text="Allow Delete:" runat="server"></asp:Label></td>
                                     <td><asp:CheckBox ID="chkboxDelete" Checked='<%# Bind("delete_privledge") %>' runat="server" /></td>
                                </tr>
                                <tr>
                                    <td><br /></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td><asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'  runat="server" /></td>
                                    <td><asp:Button ID="btnCancel" Text="Cancel" runat="server" CommandName="Cancel" CausesValidation="false" /></td>
                                </tr>
                            </table>
                        </div>            
 
                </FormTemplate>
            </EditFormSettings>
 
 
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="rowDblClick" />
            </ClientSettings>
                
        </telerik:RadGrid>
 
 
    </div>
 
    <asp:SqlDataSource ID="sqlDataSourceWebpages" runat="server" SelectCommand="SELECT * FROM dbo.security_webpage" ConnectionString="<%$ ConnectionStrings:GATEConnectionString %>"></asp:SqlDataSource>
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
David
Top achievements
Rank 1
 answered on 13 Feb 2015
17 answers
1.3K+ views
Hello,
I'm have a RadGrid with 2 template columns. During ItemDataBound I'm dynamically creating a textbox and adding it to the Grid like this:

GridDataItem gdi = (GridDataItem)e.item

TextBox tb = new TextBox();
tb.ID = tbID;
tb.EnabeViewState = true;
gdi["column name"].controls.add(tb);

"Colum name" is a template column in the grid

I have another template column with a button in it that is created at design time. When I click that button I want to be able to find the dynamically created text box in the same row of the grid and read it's value.
How do I accomplish this?

Thanks in advance
Viktor Tachev
Telerik team
 answered on 13 Feb 2015
1 answer
208 views
Hi

This is My Telerik Grid Design. How to add Textbox control in my telerik Grid when i click one button i need add new textcontrol Created this grid but client side event firing for add new textbox how will do this

How to add controls to telerik grid using Client Side thats the concept

<telerik:RadGrid ID="Telerik1" runat="server" AutoGenerateColumns="false" Height="300px"   
                    ClientSettings-Scrolling-AllowScroll="true">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="true"   />
                    </ClientSettings>
                    <MasterTableView DataKeyNames="ID">
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="ID" DataField="ID" ReadOnly="true" UniqueName="ID" />
                            <telerik:GridBoundColumn HeaderText="Name" DataField="NAME" ReadOnly="true" UniqueName="NAME">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
Viktor Tachev
Telerik team
 answered on 13 Feb 2015
3 answers
132 views
Radbutton using javascript and that 

 if (|| args.get_eventTarget().indexOf("RadButton") >= 0)
                    args.set_enableAjax(false);



protected void RadButton_Click(object sender, EventArgs e)
    {
       
            RadButton.Enabled = false;         // this is not working
    }
when ever click the button that button is disable pleas help me
Danail Vasilev
Telerik team
 answered on 13 Feb 2015
1 answer
64 views
it happened after updating the plugin and occurs only in WebKit browsers
Ianko
Telerik team
 answered on 13 Feb 2015
1 answer
37 views
In the ItemCommand event on my RadGrid I have the following section:
if (e.CommandName == RadGrid.ExpandCollapseCommandName || e.CommandName.Equals("RowClick",StringComparison.InvariantCultureIgnoreCase)) {
                e.Item.Expanded = true;
                e.Item.Selected = true;
   }

The e.Item.Expanded being set to true is taking 10-14 seconds to resolve, what could be happening that would cause such a large performance hit? 
Pavlina
Telerik team
 answered on 13 Feb 2015
3 answers
426 views
Hello, I am struggling getting the current url for the radwindow.  I always seem to obtain the original url. 

I have a radwindow hosting a webpage where I am able to perform searches internally,  Just as google, yahoo etc, the url is populated with a string of information identifying the performed search.  I need to pull the new url from the radwindow and pass it to a model popup I am using to save the string.

I have tried several options but none seem to get anything but the original url.
radwindow.get_NavigateUrl()
radwindow.Geturl() - doesn't work at all.
document.getElementById("radwindow").src

Please help,
thanks.
Marin Bratanov
Telerik team
 answered on 13 Feb 2015
1 answer
100 views
Hi all,

Using VS2013 with UI for ASP.NET AJAX Q3 2014 SP1. Below RadGrid Demo is my Prototype, 1st Grid (i.e. referencing to RadGrid1).

http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

I would like to have the flexibility to Filter the Grid with Check all, Single Selection or Multiple Selections from Filter Templates via Checkbox. Existing Functionality of the Above Grid Should remain the same.

Is it possible to Filter above Grid with ComboBox - Selection with Checkbox like below link?

http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx

Thanks a lot
Eyup
Telerik team
 answered on 13 Feb 2015
1 answer
88 views
I have radgrid popup for edit and add new record. From this popup I want to invisible the close button available on top. What is the Id for close button
 
Eyup
Telerik team
 answered on 13 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?