Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
145 views

Hello,

First, I wish you a happy new year ! :-)

Secondly, I am trying to include in the code of my RadGrid the filter template which is being shown here :  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

But it seems that to fill the DropDown boxes , you are accessing  the database each time by defining SqlDataSource objects (for example SqlDataSource1 in the code sample :

<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
       ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, ContactName, ContactTitle, City, Country, Bool FROM Customers"
       runat="server"></asp:SqlDataSource>


What I want is to have in each dropdown box only the values that really appear into the corresponding RadGrid column (data from RadGrid datasource) and not all the available values from the database. For example, if I only have 3 different records in the grid, I just want to have the three corresponding values in my drop down boxes.

So can an you tell me how to define my DataSource for all DropDonwn boxes to achieve that ?I have been looking at ObjectDataSource but it seems that by using SqlDataSource or ObjectDataSource, il will always have to send an SQL request to the database. That's exactly what I want to avoid, as I already used an SQL request to retrieve the data when populating the RadGrid ...

 Thank you for your help.

Eyup
Telerik team
 answered on 11 Jan 2013
2 answers
73 views
Dear,

      I  have used datagird to loading data , When I set up one cloumn with  checkboxSelectColumn and set up "headertext=select all"" ,But  run this page, this grid didn't display headertext,only  a checkbox in head.

     Please help me to tell me how to solve this problem. thanks a lot.



David

Wei Dong
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
63 views
Hi, I was wondering how I could go about the code behind on this. I have my grid which display records and can filter by active, inactive, etc... then when I want to look at further details, the details table does not populate and now I am getting an error on:

If

 

 

e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then

 

 

 

 

Dim record As table 1 = e.Item.DataItem<----------

 


that says:

Unable to cast object of type 'xxx.Model.database.table2' to type 'xxx.Model.database.table1' .

what is going on here?
Jayesh Goyani
Top achievements
Rank 2
 answered on 11 Jan 2013
1 answer
93 views
I have radgrid  and placing complete Radgrid  in edit mode.

I have save button in command template.

I need to update the rows when  save button is clicked.

Is there a way to know the list of changed rows on server side so I can issue the update command only to that particualr row. I do not want to issue command for all the rows irrespective  whether it is changed or not.

Thanks
Shinu
Top achievements
Rank 2
 answered on 11 Jan 2013
4 answers
136 views
Hi ,

  When we add a new row (inline form) to the radgrid . How to set focus or highlight the new row.

Thanks,
Nimmy
Jayesh Goyani
Top achievements
Rank 2
 answered on 11 Jan 2013
4 answers
161 views
Hi All,

I have a radgrid and also i have a Next button above the grid.

I wanted to show next row selected from current row on next button click through javascript
(i do not want to postback the page while doing all this activity).

if no any row is selected previously than 1st row should get selected

Please help me it's very urgent.

Thanks in advance

Chandan
Princy
Top achievements
Rank 2
 answered on 11 Jan 2013
4 answers
1.1K+ views
Hi,

I am trying to get a column value of a selected row in the radgrid.
I am using "DataKeyValues" in my C# code to retrieve the value. But it always returns an empty string. When I debug I can see the key but the value for that is empty. 
Following is my code. Please let me know if I am missing something.

Thank you,
Lahiru

ASPX page
<telerik:RadGrid ID="gridDevices" runat="server" Width="900" AllowSorting="true"   
                  AllowCustomPaging="True" AllowPaging="True" AllowFilteringByColumn="true" 
                    PageSize="10" AllowMultiRowSelection="true" OnItemCommand="RadGrid1_ItemCommand">
                <MasterTableView DataKeyNames="DeviceID"   ClientDataKeyNames="DeviceID">
            <Columns>            
                <telerik:GridBoundColumn DataField="DeviceID"  Visible="false" UniqueName="DeviceID">
                </telerik:GridBoundColumn>
             <telerik:GridTemplateColumn HeaderText="IP Address" 
                ShowFilterIcon="false" AutoPostBackOnFilter="true" UniqueName="IPAddress" DataField="IPAddress" SortExpression="IPAddress">  
                <ClientItemTemplate>
                <span title="View device web page"><a href="http://#=IPAddress#" target="_blank">#=IPAddress#</a>
</span>
                </ClientItemTemplate>
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn Visible="true" HeaderText="MAC Address" ShowFilterIcon="false" AutoPostBackOnFilter="true" UniqueName="MACAddress" DataField="MACAddress" SortExpression="MACAddress">
                <ClientItemTemplate>
                <span title="#=MACAddress#> #=MACAddress# </span>
                </ClientItemTemplate>
                </telerik:GridTemplateColumn> 
        </Columns>
        </MasterTableView>
        <PagerStyle Mode="Slider" AlwaysVisible="true" ></PagerStyle>      
       <ClientSettings>
            <DataBinding Location="SupplyGridData.asmx" SelectMethod="GetDeviceRecords">
            </DataBinding>
            <ClientEvents  OnDataBinding="DevicesGrid_DataBinding" >          
            </ClientEvents>        
            <Selecting AllowRowSelect="True"></Selecting>
        </ClientSettings>
                </telerik:RadGrid>


C# Code
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
                string deviceID = dataItem.OwnerTableView.DataKeyValues[dataItem.ItemIndex]["DeviceID"].ToString();
            }
            
        }
Shinu
Top achievements
Rank 2
 answered on 11 Jan 2013
1 answer
252 views
I have a .aspx/web form that uses the Rad Decorator.  I am using one of the Responsive frameworks on the page and have constructed a menu using ul/li that will morph into a combo box when the page width decreases past a certain point.  This is all working fine.

I would like to use the RadComboBox for the mobile-sized menu container but I cannot seem to control visibility of the RadComboBox during page size changes using the normal method of doing so from media queries -- see below.

nav select {
    display: none;
}
nav RadComboBox { display: none; }
 
@media (max-width: 800px) {
  nav ul     { display: none; }
  nav select { display: inline-block; }
  nav RadComboBox { display: inline-block; }
}

When I try to use the styles, they appear to have no effect whatsoever on the RadComboBox.  I have tried telling the Rad Decorator to ignore SELECT controls to no avail.

Is there a way through the CSS that I can control the visibility of the RadComboBox when the RadDecorator is being used?

Thanks in advance!

Lynn
Lynn
Top achievements
Rank 2
 answered on 11 Jan 2013
1 answer
93 views
We are looking to implement a responsive UI application which allows server-side events (i.e. data, sql, etc.) to be pushed to clients and have the UI refresh but not lose context. For example, we have a prototype working w/INotifyRefresh and a WPF app. However, we would like to explore the idea of doing a web app.

The new ASP.NET version has support for SignalR which allows for server events and data to be pushed to the client. Can we achieve this in ASP.NET or MVC w/out writing a massive amount of code? The application uses listviews w/checkboxes, the underlying data (ids & text) is changed, added or removed while leaving valid, existing checked state.
Alex
Top achievements
Rank 1
 answered on 10 Jan 2013
2 answers
246 views
I have a RadGrid where I am auto generating columns because they can changed depending on the source. And I want to display only certain columns and in a specific order. Its easiest for me to store the columns to display in a comma delimited string. I created the code below to try to do this. However it fails because in the Page_Load method the grid.MasterTableView.Columns is always empty, even though I do a DataBind first. Any idea how I can get this to work?

Thanks,
Jason

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        // bind
        grid.MasterTableView.DataBind();
        grid.DataBind();
  
        // columns
        var cols = grid.MasterTableView.Columns;
        foreach (GridColumn c in cols)
        {
            c.Visible = false;
        }
        // fieldNames is a comma delimited list of column names in the correct order
        var fields = fieldNames.Split(new char[',']);
        for (var j = 0; j < fields.Length; j++)
        {
            var c = cols.FindByUniqueNameSafe(fields[j]);
            if (c != null)
            {
                c.Visible = true;
                c.OrderIndex = j;
            }
        }
    }
}
Jason
Top achievements
Rank 1
 answered on 10 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?