Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
239 views
I'm looking for some example markup/code or direction on what I think is probably a fairly common thing.  But I'm having a bit of trouble figuring out the right pieces. 

I need a grid that has two checkboxes (in 2 columns) along with some other columns.  I'd also like to put a checkbox in the grid's header area above each checkbox column so that the user can toggle the checked state of all the checkboxes in that column.  I'd like that to all be done client-side.

Any guidance would be greatly appreciated.


I should mention a couple of points

1) I'm not trying to select grid rows.  In the header, if I click "Check All", I just want to iterate through all rows and set the checked state of 2 checkboxes. I don't know if the ColumnClick event is the right place to start.  And if so, how then do I loop through all the rows, find the checkbox in the row and set it's checked state to match?

2) I'm also trying to implement mutually exclusive checkboxes.  So when I click an individual checkbox in a row, I want to be sure to deselect/uncheck the other checkbox in the row.

All client-side.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 20 Feb 2012
6 answers
361 views
Hi

I have an ASP.NET 3.5 web project running in a fraemewok 4.0 pool on IIS 6.  We have an old ComboBox control (RadComboBox.Net2.dll version 2.8.4.0) that seems to not render properly. 

Each individual item renders a <div> tag with the same id (the name of the control).

Is there some fancy way we can get this to render correctly - so that it works - using the web.config file or something?

 
Ace
Top achievements
Rank 1
 answered on 20 Feb 2012
3 answers
159 views
have a hierarchical (nested) (multi-level) tabstrip with root tabs (level 1) and child tabs (level 2).  How do I auto select a child tab be default auto-selected child tab when I select a root tab??
thanks
Kevin Mason
Top achievements
Rank 1
 answered on 20 Feb 2012
4 answers
181 views
I just wanted to post this so someone else doesn't waste the 9 hours I wasted the other day.  If you are using the RadCompression Module, in conjunction with jquery/javascript ajax calls to the web server you WILL have the following issue on your Visual Studio development web server.

The following demonstrates the issue:

Standard Telerik module includes in the system.web section of the web.config:
<httpModules>
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
<add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
</httpModules>

Standard Telerik module includes in system.webServer section of the web.config:
<modules runAllManagedModulesForAllRequests="true">
    <remove name="RadUploadModule"/>
    <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
    <remove name="RadCompression"/>
    <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/>
</modules>

The results of the Ajax call with the compression module included can be seen in the screen4.png attachment.

If we turn the compression module off (as follows):
<httpModules>
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
</httpModules>


<modules runAllManagedModulesForAllRequests="true">
<remove name="RadUploadModule"/>
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
<remove name="RadCompression"/>
</modules>


The results of the Ajax call with the compression module not included can be seen in the screen5.png attachment.

Please note:  This is only an issue with the Web development server.  IIS handles the compression correctly.

I hope this helps anyone struggling with thier Ajax Calls while using telerik. 

Thanks,
Anthony
Andrew
Top achievements
Rank 1
Iron
Iron
 answered on 20 Feb 2012
4 answers
426 views
Hello,

I have a standard DateTimePicker control and I'd like to have a custom validator (server side) against it, something like this:

<telerik:RadDateTimePicker ID="picker1" runat="server" SelectedDate="<%#((DateTime)((DataRowView)Container.DataItem)[1])%>"  > 
  <DateInput DateFormat="d.M.yyyy H:mm" DisplayDateFormat="d.M.yyyy H:mm"  /> 
  <TimeView StartTime="10:0:0" EndTime="21:01:00" Interval="0:15:0" Columns="7" TimeFormat="HH:mm" Culture="cs-CZ" />  
</telerik:RadDateTimePicker> 
                     
<asp:CustomValidator ID="custValCasVykopu" runat="server" ControlToValidate="picker1" Display="dynamic" Text="Enter correct date and time" OnServerValidate="custValCasVykopu_Validate" /> 
                     

and on the server:

protected void custValCasVykopu_Validate(object source, ServerValidateEventArgs args) 
            string txtCasVykopu = args.Value; 
            DateTime casVykopu; 
            if (DateTime.TryParse(txtCasVykopu, out casVykopu)) 
            { 
                args.IsValid = true
            } 
            else 
            { 
                args.IsValid = false
            } 

Now, the problem is that in this setup, args.value is looking like this: "2010-02-27-15-00-00" and this will not parse thru DateTime.TryParse (or at least I have not found a proper combination of culture and DateTimeStyles settings that will parse this string).

My question is - is there any way to modify value property of DateTimePicker so it will produce string that will parse thru DateTime.TryParse ?

Thanks,

Antonin



Uday Anthony
Top achievements
Rank 1
 answered on 19 Feb 2012
0 answers
104 views
Hi,

I have a problem when the RadTextBox is placed within a RadAjaxPanel control as below.
By clicking submit, the RadTextBox text doesn't submitted. By removing the AutoPostBack attribute and the OnSelectedIndexChanged event of the RadComboBox controls then the RadTextBox text does submit. In addition If I don't use the RadAjaxPanel control then the RadTextBox text does submit too.

aspx:
<telerik:RadAjaxPanel ID="SSS" runat="server">
<table border="0" cellpadding="0" cellspacing="0" width="700px">
    <tr>
        <td width="120">
            <asp:Label ID="CyclLabel" runat="server" SkinID="FieldLabel" Text="Cycle:"></asp:Label>
        </td>
        <td  width="250">
            <telerik:RadComboBox ID="CycleRadComboBox" runat="server" Enabled="true" Width="215px" AutoPostBack="true" OnSelectedIndexChanged="CycleRadComboBox_SelectedIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="Select Cycle" Value="" />
                    <telerik:RadComboBoxItem runat="server" Text="BVT" Value="BVT" />
                    <telerik:RadComboBoxItem runat="server" Text="GQL" Value="GQL" />
                </Items>
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </telerik:RadComboBox>
        </td>
        <td  width="100">
            <asp:Label ID="StatusLabel" runat="server" SkinID="FieldLabel" Text="Status:"></asp:Label>
        </td>
        <td width="*">
            <telerik:RadComboBox ID="StatusRadComboBox" runat="server" Enabled="false" Width="215px" AutoPostBack="true" OnSelectedIndexChanged="StatusRadComboBox_SelectedIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="Select Status" Value="" />
                    <telerik:RadComboBoxItem runat="server" Text="Passed" Value="Passed" />
                    <telerik:RadComboBoxItem runat="server" Text="Failed" Value="Failed" />
                    <telerik:RadComboBoxItem runat="server" Text="Passed with known issues" Value="Passed with known issues" />
                </Items>
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr style="height:55px;" >
        <td valign="top" width="120">
          <div style="margin-top:9px;" >
            <asp:Label ID="CmntLabel" runat="server" SkinID="FieldLabel" Text="Comment:"></asp:Label>
          </div>
        </td>
        <td colspan="3"  width="*">
            <telerik:RadTextBox ID="CommentRadTextBox" runat="server"  Width="560px" TextMode="MultiLine" Rows="2"></telerik:RadTextBox>
        </td>
    </tr>
    <tr style="height:50px;">
        <td colspan="4">
            <asp:Button ID="SubmitButton" runat="server" SkinID="ImageAndTextButton" OnClick="SubmitButton_Click" Text="Submit" />
        </td>
    </tr>
</table>
<asp:Label ID="CommentTextLabel" runat="server" Text=""></asp:Label>
</telerik:RadAjaxPanel>

c#:
protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            CommentTextLabel.Text = CommentRadTextBox.Text;
        }
 
        protected void CycleRadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (!Convert.ToString(e.Value).Equals(string.Empty))
                StatusRadComboBox.Enabled = true;
            else
            {
                StatusRadComboBox.Enabled = false;
                CommentRadTextBox.Enabled = false;
            }
        }
 
        protected void StatusRadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (!Convert.ToString(e.Value).Equals(string.Empty))
                CommentRadTextBox.Enabled = true;
            else CommentRadTextBox.Enabled = false;
        }


Can you please expalin to me how to fix this problem?

Regards,
Bader
Bader
Top achievements
Rank 1
 asked on 19 Feb 2012
1 answer
61 views
I'm using the RadToolBar in a project and the client has requested now that instead of simply having a textbox show when "Search" is clicked (like by using itemtemplate), they want > 1 textbox to appear to the right of the menu option. All of these textboxes will be autocomplete with a button available to clear the search at the farthest right point. Any suggestions on how to make this work in the toolbar?
Kate
Telerik team
 answered on 18 Feb 2012
0 answers
138 views
Can someone help with this..
I have a a RadPanelBar that im programatically populating with RadPanelItems, and 1 CheckBoxList inside of each radpanelItem.
Below is the the code i sue to pull data from a dataset and create RadpanelItem and its checkboxlist child:
-----------------------------------------
//Loading Permission Tabs
PermissionDataSet PermissionsDS = _PermissionFactory.PermissionSelectDynamicWithTables("", "", "[dbo].[Permission].[Type],[dbo].[Permission].[Name]");
string PermissionType = "";

           //Loading DS and creating RadPanelItem/CheckboxList
            for (int x = 0; x < PermissionsDS.Permission.Rows.Count; x++) {
                PermissionDataSet.PermissionRow PermissionRow = (PermissionDataSet.PermissionRow)PermissionsDS.Permission.Rows[x];
                if(!PermissionRow.Type.Equals(PermissionType)){
                    RadPanelItem ThisRadPanelItem = new RadPanelItem();
                    ThisRadPanelItem.Value = PermissionRow.Type;
                    ThisRadPanelItem.Text = PermissionRow.Type;
                    CheckBoxList ThisCheckBoxList =  new CheckBoxList();
                    ThisCheckBoxList.RepeatColumns = 8;
                    ThisCheckBoxList.RepeatDirection = RepeatDirection.Horizontal;
                    ThisCheckBoxList.CssClass = "3column";
                    //Loading Permission Items
                    PermissionDataSet ThisPermissionsDS = _PermissionFactory.PermissionSelectDynamicWithTables("", "[dbo].[Permission].[Type] = '" + PermissionRow.Type + "'", "[dbo].[Permission].[Name]");
                    if (EditMode)
                    {
                        for (int y = 0; y < ThisPermissionsDS.Permission.Rows.Count; y++)
                        {
                            int PermissionId = int.Parse(ThisPermissionsDS.Permission.Rows[y]["Id"].ToString());
                            string PermissionName = ThisPermissionsDS.Permission.Rows[y]["Name"].ToString();
                            RolePermissionDataSet.RolePermissionRow ThisRolePermissionRow = _RolePermissionFactory.RolePermissionSelectByRoleIdAndPermissionId((int)_SelectedRole.Id, PermissionId);
                            
                            ListItem ThisListItem = new ListItem();
                            ThisListItem.Text = PermissionName;
                            ThisListItem.Value = PermissionId.ToString();
                            if (ThisRolePermissionRow != null) ThisListItem.Selected = true;
                            ThisCheckBoxList.Items.Add(ThisListItem);
                        }
                    }else{
                        ThisCheckBoxList.DataSource = ThisPermissionsDS;
                        ThisCheckBoxList.DataTextField = "Name";
                        ThisCheckBoxList.DataValueField = "Id";
                    }
                    ThisCheckBoxList.ID = "ThisCheckBoxList";
                    ThisCheckBoxList.DataBind();
                    ThisRadPanelItem.Expanded = true;
                    ThisRadPanelItem.CssClass = "RadPanelBarPageContent";

                    ThisRadPanelItem.Controls.Add(ThisCheckBoxList);
                    RadPanelBarPermissions.Items.Add(ThisRadPanelItem);

                    PermissionType = PermissionRow.Type;
                }
            }

OK the important part is how i attach the radpanelitem and checkbox to the radpanel bar as you can see bolded above, and it all works well. The page loads with all radpanelitems inserted and 1 checboxlist inside of each radpanelitem.

When i try to consume the whole radpanelbar with a loop, to check which items on the checboxlist are selected, I CANT FIND THE CHECKBOX LIST,  eventhought im able to select the radpanelitem, code below:

 ffor (int x = 0; x < RadPanelBarPermissions.Items.Count; x++)
                    {
                        //RadPanelItem ThisPanelItem = RadPanelBarPermissions.FindItemByValue("");
                        RadPanelItem ThisPanelItem = (RadPanelItem)RadPanelBarPermissions.Items[x]; THIS WORKS
                        CheckBoxList ThisCheckBoxList = (CheckBoxList)RadPanelBarPermissions.Items[x].FindControl("ThisCheckBoxList"); THIS DOES NOT WORK, Checkboxlist returns null...
.....
Youll see in the picture that the controls load normal after icreate them, but when i try to acces them, the ceckboxlist is gone!!!!
Please help!!!

Thank You.
}
Cesar
Top achievements
Rank 1
 asked on 18 Feb 2012
0 answers
60 views
I am having an interesting problem when I upgraded the .NET Framework from 2.0 to 4.0.  The problem exists in all browsers that I have tried so I don't think it is browser related.

The problem is as follows:

If I enter just the domain name it brings up the default page served up by the web server.   If I click on the panel bar it will not expand.  I've even tried opening the page with one panel expanded to see if I can click on another one to close that one and have the clicked one open.  In that case, although the one I set to open is open when the page opens, I cannot get the other panel to open when I click on it.

The panels worked fine using .NET Framework 2.0 though.  But the most interesting thing is that if I specify the default page in the browser (e.g., www.mydomain.com/Default.aspx) instead of just the domain name (www.mydomain.com) then it all works like it should (i.e., when I click on a panel it opens up fine).  Thus the problem occurs on pages that I don't specify explicitly but that the server uses by default.  My web server is IIS 6.0.

Is this a bug in the PanelBar control?

Thanks
Jay
Jay
Top achievements
Rank 1
 asked on 18 Feb 2012
1 answer
129 views

RadGrid with filters is bound to a collection of objects. When filter changes, there is an async postback during which I can determine the filters by examining FilterExpression property which has the values like this:

(iif(CatalogNumber == null, \"\", CatalogNumber).ToString().ToUpper().StartsWith(\"na\".ToUpper()))

What I want to do with this is filter the collection of object on server which the grid is bound to and looks like this:

 

 

private List<LineItem> _lineItems = new List<LineItem>

 

{

 

new LineItem { Id="4300" CatalogNumber="ab" },

 

 

new LineItem { Id="4301"CatalogNumber="naf-1"}

 

 

}

 

};

I am not sure how FilterExpression can be used in this situation and why it has these "iif" and so on.  I don't want brute force method of parsing it out and thinking that there maybe a reason why it has this format. How can I plug it in to the custom collection to filter it?

-Stan

 

Stan
Top achievements
Rank 1
 answered on 17 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?