Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
145 views
Hello Telerik Team

I'm using RadControl version : 2011.1.315.35 (for ASP.NET AJAX). I am using the Radgrid control also.
I have a simple problem. I just want to load record in Radgrid control on selection of a value in Radcombobox.
Here is the code,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Telerik.Web.UI;

public partial class GridDemo2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        using (SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString))
        {
            using (SqlDataAdapter sda1 = new SqlDataAdapter())
            {
                string qry = "select * from Categories";
                sda1.SelectCommand = new SqlCommand(qry, con1);
                DataTable dt = new DataTable();

                con1.Open();
                try
                {
                    sda1.Fill(dt);
                    RadGrid1.DataSource = dt;
                }
                catch (Exception ex) {
                }
                finally
                {
                    con1.Close();
                }
            }
        }
    }
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        if (IsPostBack)
        {
            using (SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["connect"].ConnectionString))
            {                
              using (SqlDataAdapter sda1 = new SqlDataAdapter())
            {
              string qry = "select * from Categories where Category_Name = '" + RadComboBox1.SelectedValue.ToString() + "'";
                sda1.SelectCommand = new SqlCommand(qry, con1);
                DataTable dt = new DataTable();

                con1.Open();
                try
                {
                    sda1.Fill(dt);
                    RadGrid1.DataSource = dt;
                }
                catch (Exception ex) {
                }
                finally
                {
                    con1.Close();
                }
            }

        }
    }
}


In this example I have taken a radcombobox which is bind to Categories table and datafield value is category name.
I want to fill the rad grid when radcombobox value is selected. I am passing that value in the query and on that query i want to load that 
record in the radgrid. I am not able to bind the data to radgrid.

If I am wrong in coding then please help me out.

Thanks in advance.

Regards
Anagha






Dimitar Terziev
Telerik team
 answered on 14 Jun 2011
2 answers
84 views
I have an aspx page that has some labels above a radgrid.  Is there a way I can export the page content to Excel including the labels and the radgrid vs. just exporting the grid to Excel?

Mike
Top achievements
Rank 1
 answered on 14 Jun 2011
1 answer
69 views
i have created a page with a grid and allowed paging on that grid.

when i click "next page", it goes to page 2, and when i click next again it goes back to page 1 and so on.

Please let me know how to handle this.
Vasil
Telerik team
 answered on 14 Jun 2011
3 answers
78 views

I have an issue where the RadListBox overlaps the buttons in IE6.  It's fine in IE7 and IE8.  Please see the attached screenshots. 

I have the width of the RadListBox control set to "280px", but it just seems to get ignored in IE6.  Does anyone know how to resolve this?

  

 

<telerik:RadListBox ID="RadListBox1" runat="server" Width="280px" Height="300px"
 SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBox2" AutoPostBackOnTransfer="true"

 

  AllowReorder="true" OnDropped="RadListBox1_Dropped" OnTransferred="RadListBox1_Transferred"

 

AutoPostBackOnReorder="false" EnableDragAndDrop

="true">

 

 

Dimitar Terziev
Telerik team
 answered on 14 Jun 2011
1 answer
128 views
How can I  change the calendar  button size in RadDateTimePicker  because css not working on this control.
Please help me



Thanks
Jaichand Sahany
Princy
Top achievements
Rank 2
 answered on 14 Jun 2011
1 answer
90 views
Hello,

I have a question regarding data binding a RadGrid that is hosted in a "long" list of GridTableViews and RadGrids.

The scenarios is this:
1. We have hierarchy of 4 levels . All levels are representing by a business object that has a property holding a collection of the next level. (Let's say firstLevel->secondLevel and so on).

Example:
'class FirstLevel
{
type ID;
SecondLevel[] SecondLevels;
}'
2. The last level (forthLevel) has in it's signature 2 collections. (firstSubLevel, secondSubLevel).

Example:
'class ForthLevel
{
type ID;
FristSubLevel[] FirstSubLevels;
SecondSubLevel[] SecondSubLevels;
}'

Because displaying 5 levels as "successive" grids might be hard for a user to follow we decided the two sub-levels  to be displayed in a RadMultiPage control (just as in the RadGrid demo http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx ) . To do this,  after a long list of (DetailTables as GridTableView), we try to set the last one's  NestedViewTemplate.

The problem I am facing is that I don't seem to find a way to bind the two "sub-level" RadGrid controls to the right data. Please keep in mind that all this data is coming as a collection of business objects.

How can I achieve this ?

Thank you,
Stefan
Tsvetoslav
Telerik team
 answered on 14 Jun 2011
1 answer
74 views
every time i press a button, whatever which button in the page.
it always pop out a window for an error, I will attach the message pic to it, please have a look
 
I have register for the raduploadhandler oin the web config
Dimitar Terziev
Telerik team
 answered on 14 Jun 2011
1 answer
127 views
Hello,

I get the error that the Telerik.Web.UI.StyleSheetFolder application setting is required when adding a stylesheet that's not a telerik stylesheet or an embedded one.  My question is can I set this as a property right on the RadStylesheetManager control itself, instead of in application settings?

Thanks.
Simon
Telerik team
 answered on 14 Jun 2011
1 answer
131 views
Is it possible to add and remove a row in a RADGrid using the client-side API?

The row will contain four columns - a drag and drop column, a column with a row number, a column with a text box and a column with a remove button (which needs to remove the row)

I'd like a text link above the grid to add the row.
Daniel
Telerik team
 answered on 14 Jun 2011
1 answer
74 views
I have a RadMenu in Mega Drop Down mode.
A childitem is added, and a UserControl is added to the child.

Code for adding the UserControl dynamically:
e.Item.GroupSettings.ExpandDirection = ExpandDirection.Down
e.Item.GroupSettings.OffsetX = "-476"
 
childItem = New RadMenuItem()
childItem.CssClass="MenuSlide"
e.item.Items.Add(childItem)
 
Dim uc_Products As products = DirectCast(LoadControl("~/includes/products/products.ascx"), products)
childItem.Controls.Add(uc_Products)
In the userControl there is a Repeater which must be Ajaxified so that it can be updated while the menu item is expanded.
I try it like so:

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="600px" EnableAJAX="true"
LoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="True"
HorizontalAlign="NotSet">
 
<asp:Button Text="productlines" id="btn_productlines" runat=server />
 
<asp:Repeater id="rpt_Footer" runat="server" OnItemCommand="UpdateProductGroups"
<HeaderTemplate><ul class="ProductFooter"></HeaderTemplate>
<ItemTemplate>
<li style="float:left;">
 
<asp:Literal runat=server id="ltl_rewrite" Text='<%# Container.DataItem("rewrite") %>' />
 
<asp:ImageButton
ImageUrl='<%#FormatThumbnail(Container.DataItem("foto"))%>'
Tooltip='<%#Container.DataItem("description")%>'
id="btn_Type" runat="server" />
</li>
</ItemTemplate>
<FooterTemplate></ul></FooterTemplate>
</asp:Repeater>
<asp:Label runat=server id="aa" Text="aaa" />
</telerik:RadAjaxPanel>
And in the CodeBehind:
Sub UpdateProductGroups(ByVal Sender As Object, ByVal e As RepeaterCommandEventArgs)
aa.Text = "bbb"
End Sub
When I click in the Repeater a full Postback is occuring instead of an Ajax update.

Any suggestions?

Thanks,
Marc
Kate
Telerik team
 answered on 14 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?