Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
129 views
I would like to populate a grid the same way that I populate a combo box using datarows from a dataset

The following is the code that I use to populate my combo boxes

using (DataSet dsDept = WSAccess.StepsGlobal_GetCodeTable("codDepartments"))
{
    if (Globals.IsValidDataSet(dsDept))
    {
        foreach (DataRow row in dsDept.Tables[0].Rows)
        {
            RadComboBoxItem rcbi = new RadComboBoxItem(row["DESC"].ToString(), row["ID"].ToString());
            combo.Items.Add(rcbi);
 
        }
    }
}

How would I populate a grid.

I thought I could do something like the following.
using (DataSet dsDept = WSAccess.StepsGlobal_GetCodeTable("codDepartments"))
{
    if (Globals.IsValidDataSet(dsDept))
    {
        foreach (DataRow row in dsDept.Tables[0].Rows)
        {
>>>>>>       RadGridItem rcbi = new RadGridItem(row["DESC"].ToString(), row["ID"].ToString());
>>>>>>        RadGrid.Items.Add(rcbi);
 
        }
    }
}
Of course this does not work.

Again I would like to fill in the grid one row at a time.
FYI: This grid contains three columns and could have as many as 200 rows.
I am looking to do this at the PreRender event.

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Apr 2013
1 answer
76 views
Hi Telerik,

We are planning to develop a mobile version of our prominent website which was developed using RadControls. Before we get going, I would like to know the RadControls compatibility and support with mobile devices and associated browsers.

Thanks,
Merlin.
Princy
Top achievements
Rank 2
 answered on 03 Apr 2013
1 answer
141 views
Hi,

Why there is no intellisense provided for JavaScript client side coding? Or any option to enable intellisense for JavaScript too in Visual Studio?

Thanks in Advance,
Damian.
Princy
Top achievements
Rank 2
 answered on 03 Apr 2013
3 answers
304 views
Hi,

How to use only numbers in RadCaptcha?

Thanks,
Joseph.
Princy
Top achievements
Rank 2
 answered on 03 Apr 2013
2 answers
78 views
How Can I set icon to right in RadSchedulerContextMenu:
shahab
Top achievements
Rank 1
 answered on 02 Apr 2013
2 answers
285 views
I have a problem with my link button images.

When the page first comes up, the button displays with no icon.

I move the cursor over the button, and then the icon becomes visible, and remains visible even after I've moved the cursor away.

Here's how I'm creating the buttons.

<telerik:RadButton ID="_btnEdit" runat="server" Text="Change Settings..."
                EnableBrowserButtonStyle="true"
                ButtonType="LinkButton"
                Height="32px"
                >
            <Icon PrimaryIconUrl="~/Images/Edit_16.png" PrimaryIconTop="8" PrimaryIconRight="8" PrimaryIconWidth="32" PrimaryIconHeight="32" />
 </telerik:RadButton>



The bug becomes obvious if you use the Chrome developer tools and see what's actually being rendered.

The image URL is set as "%26#39;/CMS/Images/Edit_16.png"


<span id="ctl00_Main__btnEdit" class="RadButton RadButton_Windows7 rbLinkButton" style="display:inline-block;height:32px;line-height:32px;height:32px;"><span class="rbPrimaryIcon" style="top:8px;right:8px;width:32px;height:32px;background-image:url(%26#39;/CMS/Images/Edit_16.png');"></span><span class="rbText rbPrimary">Change Settings...</span><input id="ctl00_Main__btnEdit_ClientState" name="ctl00_Main__btnEdit_ClientState" type="hidden" autocomplete="off"></span>



Once I move the mouse over the button, the rendering changes to display the correct image URL.

<span id="ctl00_Main__btnEdit" class="RadButton RadButton_Windows7 rbLinkButton" style="display:inline-block;height:32px;line-height:32px;height:32px;"><span class="rbPrimaryIcon" style="top: 8px; right: 8px; width: 32px; height: 32px; background-image: url(http://cms.datmedia.com.au/CMS/Images/Edit_16.png);"></span><span class="rbText rbPrimary">Change Settings...</span><input id="ctl00_Main__btnEdit_ClientState" name="ctl00_Main__btnEdit_ClientState" type="hidden" autocomplete="off"></span>


This was working fine. The problem seemed to occur once I wrote my own login code:this line of code in when the user logs in:

if (Membership.ValidateUser(model.UserName, model.Password))
{
    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);



Here is a similar post where somehow cookies interfere with the button images: http://www.telerik.com/community/forums/aspnet-ajax/button/radbutton-with-image-not-showing.aspx



Danail Vasilev
Telerik team
 answered on 02 Apr 2013
3 answers
230 views
<telerik:RadSiteMap ID="OrderRadSiteMap">
       <Nodes>
          <telerik:RadSiteMapNode Value="WeeklyOrder" ">
               <Nodes>
                   <telerik:RadSiteMapNode Value="GenerateOrders" />
  
CodeBehind:
RadSiteMap OrderSiteMap = (RadSiteMap)OrderMenuItem.FindControl("OrderRadSiteMap");

I need to disable the GenerateOrders.   The sitemap is nested into RadMenu, and I have no problem finding it- it's the nodes by value method that I haven't found any documentation on.
Hristo Valyavicharski
Telerik team
 answered on 02 Apr 2013
1 answer
103 views
I have a RadGrid with 3 external filter controls: 1 textbox and 2 comboboxes. Things work well when the requested data from these controls is successfully returned by the GetData() query. However, if I try to return an incorrect value from one of the controls my app blows-up stating that I have no bindable data. How can I create a scenario from which it checks to see if my DataTable returns rows and if NOT, then display a pop-up message AND to not re-bind the RadGrid? Here is my current code ...
My controls include: RadGrid1, RadComboBox1, RadComboBox2, RadTextBox1, DataTable = myDataTable, DataRows = rows.

if (condition) {rows =...}
else if (condition) {rows = ...}               
else
{
return new DataTable();
}
                 
if (myDataTable.Rows.Count == 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "norowalert", "alert('I cannot complete your request.\nThere are no records that meet your criteria.');", true);
return new DataTable();
}
if (rows.Length == 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "norowalert", "alert('I cannot complete your request.\nThere are no records that meet your criteria.');", true);
return new DataTable();
                     
}
 
if (rows.Length >= 1)
{
return rows.CopyToDataTable();
RadGrid1.DataBind();
}
return rows.CopyToDataTable();
}
Alex
Top achievements
Rank 1
 answered on 02 Apr 2013
3 answers
108 views
I have a RadRibbonBar with a several RadDatePickers. RadDatePickers works well in IE, Chrome, but not in Firefox. Popup calendar is not showed even hover effect.

Thanks for advice

Ivana

My code (snip)

 

 

 

 

 

<telerik:RadRibbonBar ID="RadRibbonBar" runat="server" Skin="Telerik" OnClientSelectedTabChanged="onSelectedTabChanged">

 

 

 

 

 

 

 

<Tabs>

 

 

 

 

<

 

 

telerik:RibbonBarTab Text="Hotel - Sestavy">

 

 

 

<telerik:RibbonBarGroup Text="Filtr">

 

 

 

<Items>

 

 

 

<telerik:RibbonBarTemplateItem Width="340">

 

 

 

<asp:Table ID="Table7" runat="server">

 

 

 

<asp:TableRow ID="TableRow19" runat="server">

 

 

 

<asp:TableCell ID="TableCell37" runat="server">

 

 

 

<asp:Label ID="Label10" runat="server" Text="Kolej" />

 

 

 

</asp:TableCell><asp:TableCell ID="TableCell38" runat="server">

 

 

 

<asp:DropDownList ID="ddlResidenceSets" DataTextField="Nazev" DataValueField="Id"

 

 

 

runat="server" Width="80">

 

 

 

</asp:DropDownList>

 

 

 

<asp:CheckBox runat="server" Text="všechny" />

 

 

 

</asp:TableCell></asp:TableRow>

 

 

 

<asp:TableRow ID="TableRow20" runat="server">

 

 

 

<asp:TableCell ID="TableCell39" runat="server">

 

 

 

<asp:Label ID="Label11" runat="server" Text="Od" />

 

 

 

</asp:TableCell><asp:TableCell ID="TableCell40" runat="server">

 

 

 

<telerik:RadDatePicker ID="RadDatePicker4" runat="server" Width="120" Skin="Telerik" >

 

 

 

<DatePopupButton ToolTip="Otevře kalendář" /></telerik:RadDatePicker>

 

 

 

<asp:Label ID="Label12" runat="server" Text="do" />

 

 

 

<telerik:RadDatePicker ID="RadDatePicker5" runat="server" Width="120" Skin="Telerik" >

 

 

 

<DatePopupButton ToolTip="Otevře kalendář" /></telerik:RadDatePicker>

 

 

 

</asp:TableCell></asp:TableRow>

 

 

 

</asp:Table>

 

 

 

</telerik:RibbonBarTemplateItem>

 

 

 

</Items>

 

 

 

</telerik:RibbonBarGroup>

 

</

 

 

telerik:RibbonBarTab>

 

 

 

</Tabs>

 

 

 

</telerik:RadRibbonBar>

 

Angel Petrov
Telerik team
 answered on 02 Apr 2013
2 answers
180 views
I have an export button that when clicked, retrieves the date set in two RadDatePickers and then exports the results of all incidents between those two dates. I also have a label that is empty if the export is successful or will display "Error: Query too large to export" if the query is too large to export to excel (this is all in a try/catch statement).  

I have 2 issues. The first is concerning the error. The label was not being updated so I placed the label change in the try statement before the ExportToExcel method just to see if it was working. If I comment out the RadGrid.MasterTableView.ExportToExcel() line, it works perfectly. However, with this line, it won't work. By won't work, I mean the export works perfectly fine but the label is never updated. Also the try/catch statement does not work at all and I wonder if that is due to the same problem.

The second issue, is that ExportToExcel() used to export to Excel 2003 while ExportToExcel2007() obviously used to export to Excel 2007. Now, ExportToExcel2007() is deprecated. Limiting the query is not an option for our system. Is there a way to export to Excel 2007? I tried using ExportToExcel() in hopes that since the two methods were combined, it would export to the latest version but it is still exporting to 2003 with a .xls extension.

If someone could help solve these two problems that would be extremely helpful!
Thanks in advance!
Emily

Update:
On further inspection of the first issue, I have found the following code in a javascript file:

function

 

pnlRequestStarted(ajaxPanel, eventArgs)

 

{

 

    if(eventArgs.EventTarget.indexOf("btnExport") != -1)

 

    {

        eventArgs.EnableAjax =

false;

 

    }

 

 

}

The problem is, I need to set this back to true I believe in order to update the label and allow the try/catch statement to function properly. Any ideas? Thanks!

Emily
Top achievements
Rank 1
 answered on 02 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?