Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
147 views

Hello All,

 I'm having problems accessing a value in the OnNeedDataSource event.  The value is a textbox in the CommandItemTemplate.  I'm using it as a custom filter while building the datasource.  I've done this before but forgot how I did it. :(  It seems that during the OnNeedDataSource the CommandItemTemplate has not been created yet. 

 

Thanks,
Jerry

Pavlina
Telerik team
 answered on 29 May 2015
1 answer
93 views

Hello,

 <telerik:RadTreeView ID="ModuleFiles" Skin="Web20" MultipleSelect="True" EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="false" runat="server" AllowNodeEditing="true"                       
OnNodeClick="trvModuleFiles_NodeClick" OnNodeEdit="trvModuleFiles_NodeEdit"                        OnClientNodeClicking="ClientNodeClicked" OnClientNodeEditStart="ClientTreeNodeEditStart" OnClientNodeEditing="ClientTreeNodeEditing">

after node editing when i click on other node (of same treeview node) OnNodeEdit does not fired

i need both the events

OnNodeClick i have saved node information.

how i can solved this problem.

Aneliya Petkova
Telerik team
 answered on 29 May 2015
2 answers
190 views

Hi,

 I'm quite new with asp and telerik components, so I need some help to figure this out:

 i'm trying to validate GridDropDownColumns that hold Combobox's and check is text area of combobox filled with value from dropdown.

 Now my problem is when I try to add custom validator in cs code side, it doesn't fire serverside validation. I don't want to add templatecollums to my grid if it's not necessary.

 in itemDataBound:

 

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
 
            GridEditableItem item = e.Item as GridEditableItem;
 
            if(item["content"].Controls[0] is RadComboBox)
            {
 
                GridDropDownListColumnEditor editor = item.EditManager.GetColumnEditor("content") as GridDropDownListColumnEditor;
 
                TableCell cell = (TableCell)editor.ComboBoxControl.Parent;
                 
                   CustomValidator validator = new CustomValidator();
 
                validator.ServerValidate += new ServerValidateEventHandler(comboboxValidations_ServerValidate);
                validator.ValidationGroup = "comboGroup";
                validator.ErrorMessage = "!";
                validator.ValidateEmptyText = true;
 
                validator.ControlToValidate = editor.ComboBoxControl.ID;
                cell.Controls.Add(validator);
 
            }
}

Rokk
Top achievements
Rank 1
 answered on 29 May 2015
8 answers
71 views

Hi

 I have a RadGgrid witht he following template section:

<telerik:GridTemplateColumn HeaderText="Arrival" SortExpression="LocationArrival" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false" UniqueName="LocationArrival">
<ItemTemplate>
<asp:CheckBox ID="chkActivityArrival" runat="server" AutoPostBack="True" visible="false" OnCheckedChanged="chkActivityArrival_CheckedChanged"/>
</ItemTemplate>
</telerik:GridTemplateColumn>

 

However when I click the checkbox the function chkActivityArrival_CheckedChanged on the server isn't being hit. The controls visibility is controlled in the code behind.

I have the same code n other grids and they work OK, what would be causing this..

Andy

Angel Petrov
Telerik team
 answered on 29 May 2015
11 answers
451 views
Hi,

I am using a gridview in this grid-view when user select item then rate column display rate. and user make input of quantity.
not i want to column amount make calculation of rate and quantity column at the same time when user input amount.
plz give me a sample example.

whtever i did is...
<telerik:RadGrid ID="radGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"
        AllowMultiRowEdit="True" OnItemDataBound="radGrid1_ItemDataBound" OnNeedDataSource="radGrid1_NeedDataSource">
        <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" ShowFooter="false" CommandItemDisplay="Top"  OnPreRender="radGrid1_PreRender">
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Product Name" UniqueName="Product_Name">
                    <ItemTemplate>
                        <asp:DropDownList ID="ddl1" runat="server" AutoPostBack="true" DataTextField="product_Name"
                            DataValueField="product_Name" OnSelectedIndexChanged="ddl1_SelectedIndexChanged">
                        </asp:DropDownList>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Product_rate">
                    <ItemTemplate>
                        <asp:Label ID="lblrate" runat="server"></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Product Quantity">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtQuantity" runat="server" />
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Product Amount">
                    <ItemTemplate>
                        <asp:Label ID="lblAmount" runat="server" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList list = (DropDownList)sender;
            GridDataItem item = (GridDataItem)list.NamingContainer;
          
            //display selected value of dropdown list.
 
            //string str = list.SelectedValue;
            //(item.FindControl("lblRate") as Label).Text = str;
             
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["chalk_hillConnectionString"].ConnectionString);
            con.Open();
            SqlCommand cmd = new SqlCommand("select product_rate from product_detail where product_name='" + list.SelectedItem.Text + "'", con);
            SqlDataReader reader; ;
            reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                (item.FindControl("lblRate") as Label).Text = reader["product_rate"].ToString();
            }
             
        }
 
protected void radGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                DropDownList list = (DropDownList)item.FindControl("ddl1");
                list.Items.Insert(0, new ListItem("select", "-1"));
                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["chalk_hillConnectionString"].ConnectionString);
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("select product_name from product_detail", con);
                DataSet ds = new DataSet();
                da.Fill(ds);
                list.DataSource = ds;
                list.DataBind();
                
            }
 
        }

with the above code i am able to display item from dropdown rate on selection of dropdownlist from database file.
now want to update order table when user input quantity.

Thanks
Maria Ilieva
Telerik team
 answered on 29 May 2015
3 answers
180 views
I'm trying to setup a grid with paging, filtering, grouping and multiselect turned on, including the check box column for selection.  I understand that when paging and filtering, any existing selected rows will become unselected.  But when I page through a grid, the row select check box column seems to become disabled - we cannot check rows to be selected after paging.  Drag and drop selection continues to work and the "select all" check box still works, but the check boxes to select individual rows do not.

I have tried simplifying our grid setup to one with just multiselect and paging but the issue remains.

Also of note we are still using a 2012 release of Telerik UI for ASP.NET AJAX.  We intend to update to the latest 2014 release in the next release of the software we are delivering to our client, but will need to continue to use the 2012 Telerik UI release for the current release of the client's software.

So is this a known issue with the 2012 releases of the grid UI?  Is there any known fix besides upgrading to a later version of Telerik UI?

Thank you,

Eric
Konstantin Dikov
Telerik team
 answered on 29 May 2015
4 answers
253 views

Hai, i am currently on project that using your very helpful Telerik UI.

I am using RadGrid, and i am following the example like in this link and i got a problem.

I am using one page and multiple UserControl. I got an error RadAjaxManager is only one in one page, and the solution i found is using RadAjaxManagerProxy.

But, i am confused how to use it? especially at Ajax Event Handler.

Please kindly help me.

Thank you in advance.

 

Maria Ilieva
Telerik team
 answered on 29 May 2015
8 answers
2.0K+ views
I am trying to open a RadWindow when clicking on a RadButton (RadButton1) but it does nothing. However when i try to do the same with an asp Button (Button3) the RadWindow opens successfully. What am i missing? Thank you in advance.
Here is a piece of the code:

<div id="ContentTemplateZone" class="qsf-ib infoBox">
    <asp:Button ID="Button3" Text="Open rad window from Button" runat="server" OnClientClick="openWinContentTemplate(); return false;">   
    </asp:Button>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Open rad window from RadButton" ButtonType="StandardButton"
    OnClientClick="openWinContentTemplate(); return false;">
        <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4"></Icon>
    </telerik:RadButton>
    <br />
    <asp:Label ID="Label1" Text="" runat="server"></asp:Label>
    <script type="text/javascript">
        function populateValue() {
            $get("<%=Label1.ClientID %>").innerHTML = $get("<%= Textbox1.ClientID %>").value;
            alert($get("<%= Textbox1.ClientID %>").value);
            //the RadWindow's content template is an INaming container and the server code block is needed
            $find("<%=RadWindow_ContentTemplate.ClientID%>").close();
        }
 
        function openWinContentTemplate() {
            alert("open");
            $find("<%=RadWindow_ContentTemplate.ClientID %>").show();
        }
    </script>
</div>
<telerik:RadWindow runat="server" ID="RadWindow_ContentTemplate" RestrictionZoneID="ContentTemplateZone" Modal="true">
          <ContentTemplate>
               <p class="contText">
                    Enter a value here and click the button to close the RadWindow and pass the
                    value to the main page.
               </p>
               <div class="contButton">
                    <asp:TextBox ID="Textbox1" runat="server"></asp:TextBox>
               </div>
               <p class="contText">
                    Via a simple JavaScript function:
               </p>
               <div class="contButton">
                    <asp:Button ID="Button1" Text="send value and close" runat="server" OnClientClick="populateValue(); return false;">
                    </asp:Button>
               </div>
               <p class="contText">
                    Via a simple method in the code-behind:
               </p>
               <div class="contButton">
                    <asp:Button ID="Button2" Text="send value through code-behind" runat="server" OnClick="Button2_Click">
                    </asp:Button>
               </div>
          </ContentTemplate>
     </telerik:RadWindow>
Marin Bratanov
Telerik team
 answered on 29 May 2015
1 answer
70 views

plz help me

 How do I find the lbljson in a nested grid?

findcontrol

<telerik:RadGrid ID="RadGrid3" runat="server" ShowStatusBar="True" AutoGenerateColumns="False"
           PageSize="7" AllowSorting="True" AllowPaging="True"
           OnDetailTableDataBind="RadGrid3_DetailTableDataBin  d" OnNeedDataSource="RadGrid3_NeedDataSource"
           OnPreRender="RadGrid3_PreRender" Skin="Bootstrap" AllowFilteringByColumn="True" GroupPanelPosition="Top" ShowGroupPanel="True" OnItemDataBound="RadGrid3_ItemDataBound">
           <PagerStyle Mode="NumericPages"></PagerStyle>
           <ClientSettings AllowDragToGroup="True">
           </ClientSettings>
           <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="True">
               <DetailTables>
                   <telerik:GridTableView DataKeyNames="ID" Name="Short" Width="100%">
                       <DetailTables>
                           <telerik:GridTableView DataKeyNames="ShortUrlID" Name="report" Width="100%">
                               <Columns>
                                   <telerik:GridBoundColumn SortExpression="Domain" HeaderText="Domain"
                                       DataField="Domain">
                                             
                                   </telerik:GridBoundColumn>
                                      <telerik:GridBoundColumn SortExpression="JsonStringReport" HeaderText="JsonStringReport"
                                       DataField="JsonStringReport">
                                             
                                   </telerik:GridBoundColumn>
                                   <telerik:GridTemplateColumn HeaderText="IP">
                                       <ItemTemplate>
                                           <asp:Label ID="Label4" runat="server" Visible="False" Text='<%# Eval("ID") %>'></asp:Label>
                                           <asp:Label ID="lbldomain" runat="server" Visible="False" Text='<%# Eval("Domain") %>'></asp:Label>
  
  
                                           <asp:Label ID="lbljson" runat="server" Text='<%# Eval("JsonStringReport") %>' Visible="False"></asp:Label>
                                           <asp:Label ID="lblIP" runat="server" Text=""></asp:Label>
                                       </ItemTemplate>
                                   </telerik:GridTemplateColumn>
                                   <telerik:GridTemplateColumn HeaderText="DateTimeClick">
                                       <ItemTemplate>
                                           <asp:Label ID="lblClickDate" runat="server" Text=""></asp:Label>
                                       </ItemTemplate>
                                   </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn AllowFiltering="False">
                       <ItemTemplate>
                           <a href="#" data-featherlight="#fl<%# Eval("ID") %>"><em class="icon-eye"></em></a>
                           <div class="lightbox" id='fl<%# Eval("ID") %>'>
                               <div class="col-lg-12">
                                   <!-- START panel-->
                                   <div class="panel panel-default">
                                       <div class="panel-heading">Target Information</div>
                                       <div class="panel-body">
                                           <!-- START table-responsive-->
                                           <div class="table-responsive"> </div>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                               </Columns>
                           </telerik:GridTableView>
                       </DetailTables>
                       <Columns>
                           <telerik:GridBoundColumn SortExpression="ShortLinkID" HeaderText="ShortURL ID"
                               DataField="ShortLinkID">
                           </telerik:GridBoundColumn>
                           <telerik:GridBoundColumn SortExpression="Domain" HeaderText="Domain"
                               DataField="Domain">
                           </telerik:GridBoundColumn>
                           <telerik:GridBoundColumn SortExpression="Count" HeaderText="Count"
                               DataField="Count">
                           </telerik:GridBoundColumn>
                           <telerik:GridBoundColumn SortExpression="Status" HeaderText="Status"
                               DataField="Status">
                           </telerik:GridBoundColumn>
  
  
                           <telerik:GridBoundColumn SortExpression="DateTime" HeaderText="DateTime"
                               DataField="DateTime">
                           </telerik:GridBoundColumn>
                       </Columns>
                   </telerik:GridTableView>
               </DetailTables>
               <Columns>
  
  
                   <telerik:GridBoundColumn SortExpression="TargetName" HeaderText="TargetName"
                       DataField="TargetName">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn SortExpression="TargetDesc" HeaderText="TargetDesc"
                       DataField="TargetDesc">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn SortExpression="Name" HeaderText="Creator" DataType="System.string"
                       DataField="Name">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn SortExpression="DateTime" HeaderText="DateTime"
                       DataField="DateTime">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn SortExpression="Status" HeaderText="Status"
                       DataField="Status">
                   </telerik:GridBoundColumn>
               </Columns>
           </MasterTableView>
       </telerik:RadGrid>

Konstantin Dikov
Telerik team
 answered on 29 May 2015
1 answer
282 views

Good day,

 we have implemented a flex layout to accommodate our typical site page setup with a formview on top and one or more radgrids at the bottom.

The flex based design uses a non stretching top space dedicated to the formview, and a stretching inferior part dedicated to the grids.

We would like to implement a dynamic pagesize solution to take advantage of our site's fluid design. We've already solved all containment challenges so the radgrid's container implements auto scroll, but because of the grids' pagesizes, the grids remain limited in vertical size and never benefit from a taller display than the 'design' one.

We would like to know how to implement a dynamic pagesize based on the grid's container height, or any equivalent paging solution that would allow our grids to resize vertically automatically and take advantage of dynamic vertical space.

Konstantin Dikov
Telerik team
 answered on 29 May 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?