Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
100 views
HI,
I want to filter second grid by first grid(rgrdcontrireport) filtering options.
I have two grids ,when i filter first grid   with that filtering option i want to filter second grid also
suppose in first grid i have batchid,userid,familyid. and i filtered first grid by batchid>12,
now this filtering i want to apply to second grid(rgrdexport)
how can i do this?
i am working on this code to get value of filtering but it is not applying to second grid(rgrdexport)
first grid (rgrdcontrireport)
second grid (rgrdexport)

  rgrdexport.AllowFilteringByColumn = true;
        GridColumn batchidexport = rgrdexport.MasterTableView.GetColumnSafe("BatchId");
        GridColumn batchid = rgrdcontrireport.MasterTableView.GetColumnSafe("BatchId");
        batchidexport.CurrentFilterFunction = batchid.CurrentFilterFunction;
        batchidexport.CurrentFilterValue = batchid.CurrentFilterValue;
       // rgrdexport.Rebind();
        expression = "BatchId " + batchid.CurrentFilterFunction + " " + batchid.CurrentFilterValue;
        rgrdexport.MasterTableView.FilterExpression = rgrdcontrireport.MasterTableView.GetColumnSafe("BatchId").EvaluateFilterExpression();

thanks ,
sameer
sameer
Top achievements
Rank 1
 asked on 26 Jul 2011
1 answer
164 views

We have a diamically created radgrid with lots checkbox column in it. They all display fine. But I have problem for looping through it and get it's value. It seems can't find the checkbox control on the page. Not sure where I missed.

foreach (Functions function in CurrentUserFunctionList)
            {
                // Set up the RadGrid's columns
                // NOTE: We have to use a custom TemplateColumn, because each checkbox is its own unique control, with its own unique ID.
                GridTemplateColumn gtcFunction = new GridTemplateColumn();
                gtcFunction.HeaderText = function.Description;
                gtcFunction.DataField = function.FunctionId.ToString();
                gtcFunction.ReadOnly = false;
                gtcFunction.AllowFiltering = false;
                // NOTE: The FunctionId gets passed in because it's part of each checkbox control's ID...
                gtcFunction.ItemTemplate = new RadGridCheckBoxTemplate(function.FunctionId.ToString());
                rgWeb.MasterTableView.Columns.Add(gtcFunction);
  
                // Set up the Data Table's columns
                DataColumn thiscolumn = new DataColumn();
                thiscolumn.Caption = function.Description;
                thiscolumn.ColumnName = function.FunctionId.ToString();
                thiscolumn.ReadOnly = false;
                thiscolumn.DataType = System.Type.GetType("System.Boolean");
                MyDataTable.Columns.Add(thiscolumn);
            }
}
  
 public class RadGridCheckBoxTemplate : System.Web.UI.ITemplate
    {
        private string colname;
  
        /// <summary>
        /// This class sets up a Template with dynamically named CheckBoxes in the RadGrid. cName is the unique identifier for th column,
        /// which is added to the ID of each CheckBox control.
        /// </summary>
        /// <param name="type"></param>
        public RadGridCheckBoxTemplate(string cName)
        {
            this.colname = cName;
        }
  
        /// <summary>
        /// Create the template
        /// </summary>
        /// <param name="container"></param>
        public void InstantiateIn(System.Web.UI.Control container) 
        {
            CheckBox checkbox = new CheckBox();
            //checkbox.AutoPostBack = true;
            checkbox.DataBinding += new EventHandler(boolValue_DataBinding);
            checkbox.ID = "cbox_" + colname;
            checkbox.CheckedChanged += new EventHandler(ToggleRowSelection);
            container.Controls.Add(checkbox);
        }
  
        void boolValue_DataBinding(object sender, EventArgs e)
        {
            CheckBox cBox = (CheckBox)sender;
            GridDataItem container = (GridDataItem)cBox.NamingContainer;
            cBox.Checked = (bool)((DataRowView)container.DataItem)[colname];
        }
  
        /// <summary>
        /// Check and uncheck
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ToggleRowSelection(object sender, EventArgs e)
        {
            ((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
        }
    }
I need to loop throug the radgrid to get all the column,

use  CheckBox cb = (CheckBox)gdi.FindControl(controlname);
or :

 

 

foreach (Control ctrl in Page.Controls)

 

{

 

 

if (ctrl is CheckBox)

 

{

 

 

string a = ctrl.ID;// never comes here to show the control id

 

}

}



I can't find any chekbox control on my page, not sure why?
Shinu
Top achievements
Rank 2
 answered on 26 Jul 2011
1 answer
294 views
Telerik,

Im trying to get the value of a TemplateColumn item when the ItemCommand event is raised. My TemplateColumn looks like the following:


<telerik:GridTemplateColumn HeaderText="User" UniqueName="User" Reorderable="false" Display="true" SortExpression="User">
    <ItemTemplate>    
        <asp:LinkButton ID="btnButton1" runat="server" ToolTip="Edit this user" CommandName="EditUser" Visible="<%# Master.UserPrefs.HasEditRights %>"><%# Eval("User") %></asp:LinkButton>                         
        <asp:Label ID="lblLabel1" runat="server" Visible="<%#!Master.UserPrefs.HasEditRights %>"><%# Eval("User") %></asp:Label>
    </ItemTemplate>                   
</telerik:GridTemplateColumn>

Basically, the template is built using a boolean value (determining if the current user logged in has EditRights to the record) to either display a LinkButton (to launch a custom edit screen) or to display a Label (if the current user doesn't have the appropriate permission).

In the ItemCommand, I would like to get the value of the data bound to either the Label or the LinkButton. The closest I got to getting the information is by doing something like the following:

protected void gvUsers_ItemCommand(object sender, GridCommandEventArgs e)
{
        RadGrid grid = (RadGrid)sender;
        switch (e.CommandName.ToUpper())
        {
            case "MyCommandName":               
                foreach (GridDataItem item in grid.MasterTableView.Items)
                {                   
                string cellContent = ((GridLinkButton)item.Cells[3].Controls[0]).Text
                }
      break;
        }
}

Is this the only way to get the Text value of the GridLinkButton? Can you please provide any other information for retrieving the values associated with a TemplateColumn using the markup in my Template?

Thanks
Shinu
Top achievements
Rank 2
 answered on 26 Jul 2011
1 answer
69 views

Hi All,

Is it possible to implement drag  and drop functionality from a treeview to a grid using only javascript. 

I need to populate some hiddedn columns in the grid view that based on the node that is being dropped in the gridview.


Thanks
Abhi

Shinu
Top achievements
Rank 2
 answered on 26 Jul 2011
8 answers
902 views
I add datepicker to webform
set min date to 1/1/1900
set max date to 12/31/2099
user opens webform on existing record with date of 1/15/2300 (outside min/max date)
a runtime error occurs.

Question(s):
Why the runtime error?  this is causing us grief.  why doesn't validation just trigger on the datepicker control and display a validation error in the ui? 
If i add the datepicker to 100s of forms, do i really have to add try/catch error handling for each when setting the date value of the control? this is a real pain.



B
Top achievements
Rank 1
 answered on 26 Jul 2011
3 answers
148 views
Hi,
I want to create multiple Header rows in My Grid view , The Grid view will be Like this.. Below Some t-shirt qty will not be available that Qty and amount should not be display in the grid. how can we do this for this below scenario

 

          M

 

          XL

          XXL

T-Shirts

Qty

Amount

Qty

Amount

Qty

Amount

Nike

1

300

 

 

2

4

Reebok

 

 

1

3

 

 

Smash

 2

 145

 

 

2

3

Shinu
Top achievements
Rank 2
 answered on 26 Jul 2011
1 answer
83 views
When a listbox is sorted on the client side, upon postback i want to be able to iterate through the newly sorted values, however the standard .Items list is still in the original order. How do I access the items in the new order?

foreach (RadListBoxItem item in RadListBox1.Items)
Thad
Top achievements
Rank 2
 answered on 26 Jul 2011
2 answers
87 views
hi ,
       My rad window is opening in centre always. i have set keepin screenbounds as true.
The problem is when i scroll the main window the radwindow also gets moved . I want my radwindow displayed in centre even if i scroll the main window.

 please help. Urgent

deva sudan
Top achievements
Rank 2
 answered on 26 Jul 2011
6 answers
176 views
Hi,
I am trying to create a variable for the RadTabStrip on my page, but $find keeps returning a null value. Here is my code (the javascript is in a RadCodeBlock at the foot of the page):

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <link href="css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.5_1.js" type="text/javascript"></script>
    <script src="js/behaviours.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <ClientEvents OnRequestStart="jsAjaxStarting" OnResponseEnd="ajaxFinished" />
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="Button1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="Button2">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="Panel2" />
                                <telerik:AjaxUpdatedControl ControlID="tab1IsAJAX" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>               
                    </AjaxSettings>
        </telerik:RadAjaxManager>
         
        <div id="loadingDiv" class="screenCenter" style="display: none;">
            <br />
            <br />
            <span>LOADING</span>
        </div>       
 
        <telerik:RadTabStrip ID="TestRadTabStrip" runat="server"
                             OnClientLoad="jsStoreLicenceApplicTabStripClientObject"
                             SelectedIndex="0" MultiPageID="RadMultiPage1">
            <Tabs>
                <telerik:RadTab PageViewID="RadPageView1" runat="server" Text="Tab 1" Value="Tab1" ></telerik:RadTab>
                <telerik:RadTab PageViewID="RadPageView2" runat="server" Text="Tab 2" Value="Tab2" ></telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
         
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
            <telerik:RadPageView ID="RadPageView1" runat="server">
                <asp:Panel ID="Panel2" runat="server">     
                    <p>This is page 1</p>
                </asp:Panel>
                <asp:Button ID="Button1" runat="server" Text="Go to Tab 2" OnClick="Click1" /><br />
                <asp:Label ID="tab1IsAJAX" Text="" runat="server" />
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadPageView2" runat="server">
                <asp:Panel ID="Panel1" runat="server">               
                    <p>This is page 2</p>
                    <asp:Button ID="Button2" runat="server" Text="Go to Tab 1" OnClick="Click2" /><br />
                    <asp:Label ID="tab2IsAJAX" Text="" runat="server" />
                </asp:Panel>
                <asp:Button ID="Button3" runat="server" Text="Hide Panel" /><br />                       
            </telerik:RadPageView>           
        </telerik:RadMultiPage>       
         
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
 
                $(document).ready(hookUpEvents);
                 
                function hookUpEvents() {
 
                    var tabId = '<%= TestRadTabStrip.ClientID %>';
                    var tabStrip = $find(tabId);
 
                    debugger;
 
                    if (tabStrip) {
                        var selectedTab = tabStrip.get_selectedTab();
                        var tabvalue = selectedTab.get_value();
                    }
 
                    if (tabvalue === 'Tab2')
                        $('#' + '<%= RadPageView2.FindControl("Panel1").ClientID %>').bind('click', hidePanel);
                }  
            </script>
        </telerik:RadCodeBlock>
         
    </div>
    </form>
</body>
</html>

I am using a Web site project template and Telerik.Web.UI, Version=2010.3.1215.35

Any help would be appreciated. Cheers
David
Top achievements
Rank 1
 answered on 26 Jul 2011
2 answers
300 views
Hi,

Does any one know to select multiple checkboxes in a RadGrid? I have a .net webpage, it has a dropdownlist which has values(1,2,3,4,5,6). When I select a value from the dropdownlist it should select the same number of checkboxes in the RadGrid, starting from first row. I tried to write some clientside javascript code to capture the value and then set it to the rows in RadGrid. Does anyone know how you can achive this. Help will be appreciated.

Thanks,
Raji
Raji
Top achievements
Rank 1
 answered on 26 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?