Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
Hi,

I was trying to get the example of simple filtering working that is located at this location http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx. I was able to get it working without too much trouble. The issue is that when I removed the 'DataSourceID="SqlDataSource1' from the Grid and used code in the Page_Load method to set the Datasource of the grid the filtering did not work. I set the datasource to be a list of ints. I have also tried using the NeedDataSource event of the grid itself to populate the grid, but again the grid will be populated but when I go to filter it doesn't filter.  Here is sample of the code I am using to set the datasource of the grid:

SqlCommand sql =

new SqlCommand();

 

SqlDataAdapter da =

new SqlDataAdapter();

 

 

string connectionString = WebConfigurationManager.ConnectionStrings["SBF"].ToString();

 

SqlConnection con =

new SqlConnection(connectionString);

 

 

//ConfigurationManager.ConnectionStrings[connectionString]

 

con.ConnectionString = connectionString;

sql.CommandText =

@"select A from SSA";

 

sql.Connection = con;

da.SelectCommand = sql;

DataTable dt =

new DataTable();

 

 

List<int> ints = new List<int>();

 

da.Fill(dt);

 

for (int i = 0; i < dt.Rows.Count; i++)

 

{

ints.Add(

Convert.ToInt32(dt.Rows[i]["A"]));

 

 

}

RadGrid1.DataSource = ints;

I am using the 2009.3.1208.35 version of the Telerik.Web.UI.

Thanks,
Jonathan Simon

Yavor
Telerik team
 answered on 15 Apr 2010
1 answer
202 views
hi,
    
    i have a radgrid in my page. in the need_datasource method i assign the grid's datasource to a list of objects returned from the business layer. but my problem is if the list is returned as null, (means no records) the grid disappears. i want the grid to show the empty item template. how to achieve this? please help.

Regards,
Saravanan K
Radoslav
Telerik team
 answered on 15 Apr 2010
2 answers
317 views

I want to set the DataTextField of a RadComboBox at pageload according to the users prefered language - and keep that value.
So far my code looks like this:
(a small part of the mastertableview of the grid RadGridVehicle)

                <telerik:GridDropDownColumn DataSourceID="sdsHaulierType" 
                                            DataField="HaulierType" DataType="System.Int32" 
                                            HeaderText="Haulier type"   
                                            ReadOnly="true" 
                                            ListTextField="HaulierTypeName"   
                                            ListValueField="HaulierTypeID"   
                                            DropDownControlType="DropDownList" 
                                            SortExpression="HaulierType" 
                                            UniqueName="HaulierType" 
                                            EditFormColumnIndex="0"   
                                            Visible="true" ForceExtractValue="Always" >  
                    <FilterTemplate>  
                        <telerik:RadComboBox ID="cbHaulierType" runat="server"   
                                             AppendDataBoundItems="true" 
                                             DataSourceID = "sdsHaulierType" 
                                             DataValueField = "HaulierTypeID" 
                                             DataTextField = "HaulierTypeName" 
                                             SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("HaulierType").CurrentFilterValue %>'  
                                             OnClientSelectedIndexChanged="HaulierTypeChanged">  
                            <Items>  
                                <telerik:RadComboBoxItem Text="All" />  
                            </Items>  
                        </telerik:RadComboBox>  
                        <telerik:RadScriptBlock ID="sbHaulierType" runat="server">  
                           <script type="text/javascript">  
                                function HaulierTypeChanged(sender,args)   
                                {  
                                    var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                    tableView.filter("HaulierType",args.get_item().get_value(),"EqualTo");                                      
                                }  
                            </script>   
                        </telerik:RadScriptBlock>  
                    </FilterTemplate>  
                </telerik:GridDropDownColumn> 

I'm using a table called HaulierType with the following columns:
  • HaulierTypeID (PK)
  • HaulierTypeName (default column for DataTextField in the RadComboBox)
  • SVHaulierType
  • DAHaulierType
    <asp:SqlDataSource ID="sdsHaulierType" runat="server"   
                       ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"   
                       SelectCommand="SELECT * FROM [HaulierType]">  
    </asp:SqlDataSource> 

I can get the grid to show the correct values like this:
protected void RadGridVehicle_Load(object sender, EventArgs e)  
    {  
        ddc = (GridDropDownColumn)RadGridVehicle.MasterTableView.Columns.FindByUniqueName("HaulierType");  
        if (userLang == "da")  
        {  
            ddc.ListTextField = "DAHaulierType";  
        }  
        else if (userLang == "sv")  
        {  
            ddc.ListTextField = "SVHaulierType";  
        }  
    } 

What's missing is setting the filtervalues in the gridcolumn.
How do I set the DataTextField serverside and in which event?

Please help - I'm totally stock.
BOS
Top achievements
Rank 1
 answered on 15 Apr 2010
2 answers
142 views

Hi,

I am getting the following error after upgrading my site to use the 2010 Q1 release:

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.


Quick goolge found it is something to do with the server not having .net 3.5 SP1 installed. Is this required for 2010 Q1 release?

Thanks
Tom
Jeff
Top achievements
Rank 1
 answered on 15 Apr 2010
2 answers
142 views
Hi.

So, I installed Visual Studio 2010 Premium RTM but I had previously installed Telerik RadControls for ASP.NET AJAX Q1 2010. The controls show up in the toolbox but VSX is not in the menu. Is there a way to register it without re-installing RadControls?

Thanks.
Jose
Jose
Top achievements
Rank 2
 answered on 15 Apr 2010
4 answers
166 views
I am trying to build a treeview where each root node has a member name, below each name i am trying to create a listview of items that are associated to each member based on memberid.

The treeview nodes cannot be dragged or edited, the listview should allow for add/update and delete functionality.





I am having trouble creating the listview in the child template.

Any assistance would be appreciated.


Kevin Mauriello
Top achievements
Rank 1
 answered on 14 Apr 2010
1 answer
97 views
Hi Folks,

I am trying to to get the itemindex in the textchanged event.

Can anyone help me out on this.
Protected Sub txtEditPileDia_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) 
        Try 
            objDetailInfo = New NDSBLL.DetailInfo 
            objDetailDal = New NDSDAL.DetailDal 
            Dim txtNewPileDia As TextBox 
            Dim txtLinkStart As TextBox 
            Dim txtLinkEnd As TextBox 
            'Dim txtAdditionalSpiral As TextBox 
            Dim intIndex As Integer = ???? 
            txtNewPileDia = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtPileDia"), TextBox) 
            txtLinkStart = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoLinksStart"), TextBox) 
            txtLinkEnd = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoLinksEnd"), TextBox) 
            'txtAdditionalSpiral = DirectCast(gvStructDetails.Rows(intIndex).FindControl("txtEditNoAdditionalSpiral"), TextBox) 
            If ((Not txtLinkStart Is Nothing) And (Not txtLinkEnd Is Nothing) And (Not txtNewPileDia Is Nothing)) Then 
                PopulateLinksValues(txtNewPileDia, txtLinkStart, txtLinkEnd) 
            End If 
        Catch ex As Exception 
            ErrorHandler.RaiseError(ex, strPath) 
        End Try 
 
    End Sub 

Below is my Code and the line below is wht i am expecting.....

 Dim intIndex As Integer = ????


Thanks
Satya
Daniel
Telerik team
 answered on 14 Apr 2010
2 answers
175 views
Hello,
I have a database with the columns NewsID, date, category, title and content. I want to show the date, category and title in a Telerik Listview. When you click on the title (which is a hyperlink in the listview), I want to load a subpage with the full article (title+content). In which subpage it is loaded, depends on the category of the article. When the category is for example 'general', it is loaded in the default-page. When the category is 'dogs', it is loaded in subpages/dogs.aspx. When the category is 'fishes', it is loaded in subpages/fishes.aspx.

When I use a standard datalist, I do it in the following way:
 
    Protected Sub DataList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles DataList.ItemDataBound  
        Select Case e.Item.ItemType  
            Case ListItemType.Item, ListItemType.AlternatingItem  
                Dim myRow As DataRowView = CType(e.Item.DataItem, DataRowView)  
                Dim hype As HyperLink = e.Item.FindControl("DatalistHyperlink")  
                If myRow.Item("category") = "General" Then 
                    hype.NavigateUrl = "default.aspx?NewsID=" & myRow.Item("NewsID")  
                Else 
                    hype.NavigateUrl = "subpages/" & myRow.Item("category") & ".aspx?NewsID=" & myRow.Item("NewsID")  
                End If 
        End Select 
    End Sub 
 
What is the solution for this problem when I use a Telerik-listview instead of a standard datalist?

Thanks in advance.
David De Backer
Top achievements
Rank 1
 answered on 14 Apr 2010
5 answers
377 views
Hi,
how to change background color of RadWIndow in css file in the Telerik version (2009)?
Thx.
Andrew
Top achievements
Rank 1
Veteran
Iron
 answered on 14 Apr 2010
2 answers
137 views
Hi,
this is my first time: i've never before posted something here but now I need your help
Yesterday we have upgraded all PCs in our company to Visual Studio 2010 (official version) and before this I've worked on a project with VIsual Studio 2010 Beta and Telerik's ASP.NET AJAX Controls Q1 2010. Yesterday (before installing VS 2010) all works correctly but now when I try to add a control in design wiev, I can't find the controls in VS 2010 Toolbox. I tried to uninstall and reinstall Telerik again but whitout a sollution. Anyway, in the code wiev I can add all constrols correctly, but sometimes I need to use design wiev too. I tried to add a new Telerik ASP.NET AJAX project but i cannot find Telerik controls in Toolbox window in this project too. Where can be the problem?
Thanks,

Michele
Michelle
Top achievements
Rank 1
 answered on 14 Apr 2010
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?