Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
1.3K+ views
Version: Q1 2009 (.NET 3.5)
Language: C#
Dev: VS 2005

I have a page that allows the user to select a database table from a dropdown list and display the data in a RadGrid.  The RadGrid is set to automatically generate columns and allow scrolling and sorting.  If I switch between tables without sorting, I get no errors.  However, if I pick a table, sort on a column, and then select another table to view, I get a runtime error of "[column] is neither a DataColumn nor a DataRelation for table [tablename]."   Code snippet below. 

protected void RefreshData() 
        { 
          DataSet  ds; 
          string   query; 
          string   tableName; 
           
          // clear old data 
          UserMsg.Text = ""
          Cache.Remove("wadv_ds"); 
          clearGrid(); 
 
          // get data 
          tableName = cbTableList.SelectedValue; 
          query = @"SELECT * FROM " + tableName; 
          ds = dba.ReadData(query, tableName); 
 
          // update grid 
          if (ds == null) 
            { 
              UserMsg.Text = "DataSet is null."
            } 
           else if (ds.Tables[0].Rows.Count == 0) 
            { 
              UserMsg.Text = "Table has no data."
            } 
           else 
            { 
              Cache["wadv_ds"] = ds.Tables[0]; 
 
              rgData.DataSource = ds.Tables[0]; 
              rgData.DataBind();                               //  <=== ERROR OCCURS HERE 
            } 
        } 
        //------------------------------------------------------------------------- 
    protected void clearGrid() 
    { 
      rgData.DataSource = null
      rgData.DataBind(); 
      rgData.Columns.Clear(); 
    } 
    //------------------------------------------------------------------------- 

Any help resolving this would be greatly appreciated.  Thanks.
Swapna
Top achievements
Rank 1
 answered on 16 Sep 2011
3 answers
127 views
I have a method that I use to reset a form after a submit or if the user chooses to click a reset button. For the most part it works, however if Im using a combobox that is tied to a LoadOnDemand event, the selected item is still displayed. It does appear that the remaining items are reloaded when I click the dropdown arrow.

Here is the code I'm using:

public static void resetForm(Control parent)
 {
     foreach (Control c in parent.Controls)
     {
         if (c.Controls.Count > 0)
         {
             resetForm(c);
         }
         else
         {
             switch (c.GetType().ToString())
             {
                 case "Telerik.Web.UI.RadTextBox":
                     ((RadTextBox)c).Text = "";
                     break;
 
                 case "Telerik.Web.UI.RadComboBox":
                     ((RadComboBox)c).ClearSelection();
                     ((RadComboBox)c).Text = string.Empty;
 
                     break;
 
                 case "Telerik.Web.UI.RadTimePicker":
                     ((RadTimePicker)c).Clear();
                     break;
 
                 case "Telerik.Web.UI.RadDatePicker":
                     ((RadDatePicker)c).Clear();
                     break;
 
                 case "System.Web.UI.WebControls.CheckBox":
                     ((CheckBox)c).Checked = false;
                     break;
 
             }
         }
     }
 }

Thanks,
Kalina
Telerik team
 answered on 16 Sep 2011
13 answers
251 views
Hi

I am trying to get Template columns Total to be updated on Footer  and Label outside the Grid

Here is my scenario

i have qty,price,discount and total(which is calculated client side). So when the user enters the qty and selects the price and
 discounts(if any)  i calculate the total on client side.
As user can select multiple items, total is calculated accordingly. But i want the Sum of total in the footer and also label which is outside the grid. Can we show the sum in the footer  and also  in the label using client side functions

Please suggest

Thank you
Kavya
Kavya
Top achievements
Rank 2
 answered on 16 Sep 2011
5 answers
138 views
I am having an issue with my radmenu submenu not closing when I have EnableRootItemScroll = "true".

I found the same bug here on the website in this location: http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/scrolling/defaultcs.aspx

To reporduce:
Mouse over "Format"
Then "Font"
Them mouse over one of the fonts(ex. Verdana)
Then move your mouse up out of the menu.

All the submenu's should stay open. All the browsers I have tested this on have the same result.

If somebody knows a fix to this that would be a great help.

Thanks
Zach
Kate
Telerik team
 answered on 16 Sep 2011
2 answers
87 views
I want to make Organization Chart  with asp.net that Gets It's Data from sql database
is there any Telerik control can do this
thanks
michel
Top achievements
Rank 1
 answered on 16 Sep 2011
1 answer
355 views
I have a RadGrid with multiple select enabled:

<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false" AllowMultiRowSelection="true">
    <MasterTableView TableLayout="Fixed">
        <Columns>
            <telerik:GridBoundColumn DataField="Dialog" HeaderText="Dialog" DataType="System.String" />
        </Columns>
    </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true">
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowSelected="RowSelected"/>
    </ClientSettings>
</telerik:RadGrid>

And the OnRowSelected event triggers for each row selected. When selecting 10 rows, the event gets fired 10 times. Simple enough.

My question is what event can I listen to to know when all the rows that are going to be selected are selected (as a result of the multiple selection)? I need to make a post request with the ids of the selected rows and I don't think it's a good idea to let 10 post request be made. I can query the grid to get the selected rows, I just need to know when to do it; ideally something that doesn't involve timeouts. There must an event for this that I'm overlooking.

Levi
Top achievements
Rank 1
 answered on 16 Sep 2011
2 answers
111 views
Hi,

I've looked thru the forums, and can't seem to find an answer to my question so here goes:

I have a Spell Check button on my web page, but my clients are complaining that the fonts are too small.  How is the easiest way to enlarge the fonts for the spell check find and replace dialog box?  Below is the code I use to implement:


In the vb.net we set the fields to check spelling...
        Dim aar As Array = Split(ss, ",")
        RadSpellCheck.ControlsToCheck = aar


In the asp.net
 <script type="text/javascript">
   function OnClientLoadx(spell)
   {
      spell.set_useClassicDialogs(true);
   }   
</script>   
<telerik:RadSpell ID="RadSpellCheck" runat="server" AllowAddCustom="False" OnClientLoad="OnClientLoadx"/>

Thanks in advance for your assistance on this!!
ChuckRock
Top achievements
Rank 1
 answered on 16 Sep 2011
6 answers
215 views
Hello,

How
do I set the column order in C #. Net by code
so:

Column1
, column2, column3
to
Column2, column1, column3
Stefan
Telerik team
 answered on 16 Sep 2011
3 answers
72 views
I would like for our users to be able to click on the text of the node and cause the box to be checked.  Is this possible?  If not, is there a way to prevent the selected node from changing colors to avoid a scenario where users believe they have 'checked' the node?

Thanks!
Plamen
Telerik team
 answered on 16 Sep 2011
1 answer
116 views
Hi Guys,

I have a RadGrid and I need to place a hyperlink in the ItemTemplate. If I hard code the NavigateURL to "Supplier.aspx?ID=1079" everything works well. However, I want to replace the "1079" with the supplier id for this particular record and I just can not get the syntax correct. How do I get Eval("suplid") into the NavigateURL?

<asp:HyperLink ID="HyperLink11" runat="server" NavigateUrl='Supplier.aspx?Supplier=1079'><%# Eval("suplnm")%></asp:HyperLink>

William
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?