Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
130 views
Using this example, http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultcs.aspx

How can I show the all of the columns from the selected row in the dropdown after it has been selected?

Thanks
Princy
Top achievements
Rank 2
 answered on 26 Jul 2011
1 answer
289 views
Hi all,
  I am using Rad Date Ticker and Rad Time Picker for entering date range. For 2 Rad Date Picker i used one compare validator and also use one compare validator for 2 Rad Time Picker. If i chnage any startime i got error from compare validator even if endtime is greater than starttime. For date comparison i added type as date in compare validator. But how can i configure for radtime picker?
But if i change or just select end time again error is cleared.

<telerik:RadTimePicker ID="radstarttime" runat="server"  Width="225px" >
    <TimeView CellSpacing="-1" Columns="6" Interval="00:30:00" ></TimeView>
</telerik:RadTimePicker>
<asp:RequiredFieldValidator ID="rfvStartTime" Display="Dynamic" ValidationGroup="EditValidation" SetFocusOnError="true" runat="server" ControlToValidate="radstarttime" ErrorMessage="Start Time is Mandatory!!!" Text="*" ForeColor="Red">
</asp:RequiredFieldValidator>
   
<telerik:RadTimePicker ID="radendtime" runat="server" Width="225px"> 
    <TimeView CellSpacing="-1" Columns="6" Interval="00:30:00"></TimeView>
</telerik:RadTimePicker>
<asp:RequiredFieldValidator ID="rfvEndTime" Display="Dynamic" ValidationGroup="EditValidation" SetFocusOnError="true" runat="server" ControlToValidate="radendtime" ErrorMessage="End Time is Mandatory!!!" Text="*" ForeColor="Red">
</asp:RequiredFieldValidator>
  
<asp:CompareValidator ID="crvEndTime" runat="server" ControlToCompare ="radstarttime" ControlToValidate ="radendtime" Operator ="GreaterThanEqual" ErrorMessage ="End Time Must be Greater than Start Time" >
</asp:CompareValidator>


Shinu
Top achievements
Rank 2
 answered on 26 Jul 2011
0 answers
124 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
204 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
350 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
90 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
997 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
204 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
110 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
114 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?