Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
209 views
Hi Guys

I have a combo box in the edit item of a grid column, and I wanted to combine two column values to provide the DataTextField content.
It does sort of work, in that the values in the drop down box are as expected, but after one of them is selected, the combox is empty instead of showing the selected value.  You can see I tried to use a modified query in the SQL datasource as the simplest way, but obviously it is not the complete answer. Can you put me on the right track?

Code is as below.

Thanks

Clive

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="XXXXXX"
SelectCommand="SELECT [AuthCode], ([FirstName] + [LastName]) AS [Name]  FROM [Authors]
ORDER BY [LastName], [FirstName]">
</
asp:SqlDataSource>
 
 
 
<telerik:GridTemplateColumn DataField="AuthCode" HeaderText="AuthCode" SortExpression="AuthCode"
UniqueName="AuthCode" Visible="False">
<EditItemTemplate>
    <telerik:RadComboBox ID="RadComboBox1" runat="server"
          DataSourceID="SqlDataSource2" DataTextField="Name"
          DataValueField="AuthCode" SelectedValue='<%# Bind("AuthCode") %>'
          Width="200px" AllowCustomText="True" EmptyMessage="Pick author">
    </telerik:RadComboBox>               
   </EditItemTemplate>
<ItemTemplate>             
     <asp:Label ID="AuthCodeLabel" runat="server" Text='<%# Eval("AuthCode") %>'></asp:Label>
     </ItemTemplate>
</telerik:GridTemplateColumn>
Shinu
Top achievements
Rank 2
 answered on 12 Nov 2012
5 answers
249 views
hi,

i am using raddatepicker in my aspx page. i have to clear the value entered in the raddatepicker when the submit button is clicked.

i tried with raddatepicker.clear() but it is not working.

below is the code in the aspx page 

<

 

telerik:RadDatePicker ID="rdpDueDate" runat="server" Culture="English (United States)"

 

 

 

 

Width="90px">

 

 

 

 

 <DateInput ID="DateInput1" runat="server" InvalidStyleDuration="100" TabIndex="3">

 

 

 

 

</DateInput>

 

 

 

 

<Calendar ID="Calendar1" runat="server" Style="position: absolute; padding: 0 0 0 0px;

 

 

 

margin: 0 0 0 0px;">

 

 

 

 

<SpecialDays>

 

 

 

 

<telerik:RadCalendarDay Repeatable="Today">

 

 

 

 

<ItemStyle CssClass="specialDay" />

 

 

 

 

</telerik:RadCalendarDay>

 

 

 

 

</SpecialDays>

 

 

 

 

</Calendar>

 

 

 

 

<DatePopupButton TabIndex="3" />

 

 

 

 

</telerik:RadDatePicker>

 Any help on this will be greatly appreciated.

 

 

 

 

Princy
Top achievements
Rank 2
 answered on 12 Nov 2012
8 answers
275 views
Hello,

Our website uses RadGrids that are created entirely in code-behind, because each grid's columns are controllable by the user.  The user is allowed to add and remove columns as well as move columns around.  I used the following articles as the basis for the page architecture:

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
http://www.telerik.com/help/aspnet-ajax/grdchanginggridstructuredynamically.html

The grid is created dynamically, and added to a placeholder control that is defined on the page.  In addition, the columns are created dynamically, in the OnInit method of the page.

As a side note:  In the first article referenced above, it states that if you are creating the grid entirely in code-behind: "No ViewState is required for grid structure to be persisted as it is recreated on each page initialization".  However, this is not entirely true, because if you allow sorting, and if viewstate is disabled, you cannot click on the sort icon to affect a sort.

Regardless of whether the grid's viewstate is enabled or not, the problem arises when I sort a column, and then delete the sorted column.  When I delete the sorted column, I get the following error:

Sys.WebForms.PageRequestManagerServerErrorException: An error has occurred because a control with id 'ctl00$ContentPlaceHolderMain$ItemView1$grid1$ctl00$ctl02$ctl01$ctl09' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.

The id of the offending control might be different each time, but when I look at the HTML, it always corresponds to the <input type="image"> tag that represents the sort icon (the up/down arrow).  This input tag has a name attribute that matches the control name in the error message, but it has no ID attribute.  I don't know if this is the reason for the error or not.  I also get the above error when adding a column, and moving that column to a position to the left of the sorted column.

In any case, I am having a difficult time creating a small test project that duplicates the behavior.  In the meantime, I was wondering if Telerik or anybody has encountered this problem and hopefully found a solution.

Thanks for any help!
Steve

Alex Galie
Top achievements
Rank 2
 answered on 12 Nov 2012
2 answers
125 views
Hi
I am making one demo in that i am performing add and update in Rad Grid(InPlace) from outside of button click.
everything works fine. when i am adding a new record insertion is happening successfully but Rad Grid is not closing the addition
form(InPlace).
i am also rebind the RadGrid but that not work's for me.
Please help me on this.
anuj
Top achievements
Rank 1
 answered on 12 Nov 2012
6 answers
304 views
I am using the client side binding with Jquery and seeing that the paging is not working.
Is this a known issue?  IE version I am testing this on is 8.0.6001

Please see the image attached. Even though the page size is 10. All records are shown on each page.
Is there something I am missing. I downloaded the example from Telerik RadGrid client-side data-binding using jQuery
and just ran it.

Any help is appreciated.

Thanks,
Madhu
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Nov 2012
0 answers
84 views
Hello,
     I am getting error in Radscheduler when i click in the export button.
    I also attach error file.

Please help me as soon as possible.

Thanks

Best Regards,
Jiten Mutum
Jiten
Top achievements
Rank 1
 asked on 12 Nov 2012
2 answers
110 views
Hello!

I am trying to bind a hierarchial using a web service. I've read that this is not natively supported by the RadGrid, but I'm hoping it's still possible to do it. I have previously bound the grid server-side to a hierarchial source and that worked fine.

Attached is my project in its current state. I am able to get the first level of data bound in the grid, but the second level is however lost. I am guessing this has something to do with the OnDetailTabelDataBind server-side event which I used to attach the detail data to the parent data, but it is no longer firing because I am using client-side binding.

Can anyone help me out here? I am guessing I will have to manually assign each detail row to the corresponding detail data that's available in the grid's source, but I am not sure. I'm thinking, since I have all the data available (I fetch all data once - I don't want to ask the server for the details data once the row is expanded), would it be possible to do something in the OnRowDataBound client event? Maybe iterate through all detail items and manually bind them to detail rows?

Below is my code. If anyone's able to have a look I'd be grateful.

Thanks in advance.

<telerik:RadGrid runat="server" AutoGenerateColumns="false"
           ID="RadGrid1" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
           Skin="Default">
           <ClientSettings>
               <DataBinding Location="WebService.asmx"
                   SelectMethod="TestGetData" ShowEmptyRowsOnLoad="false" />
           </ClientSettings>
           <MasterTableView DataKeyNames="" HierarchyLoadMode="Client">
               <Columns>
                   <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name"></telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="ArticleNumber" DataField="ArticleNumber" HeaderText="Article Number"></telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="SerialNumber" DataField="SerialNumber" HeaderText="Serial Number"></telerik:GridBoundColumn>
               </Columns>
               <DetailTables>
                   <telerik:GridTableView Name="Details" runat="server" AutoGenerateColumns="false">
                       <Columns>
                           <telerik:GridBoundColumn UniqueName="Name" DataField="MockData.Name" HeaderText="Name"></telerik:GridBoundColumn>
                           <telerik:GridBoundColumn UniqueName="OS" DataField="MockData.OS" HeaderText="Operating System"></telerik:GridBoundColumn>
                       </Columns>
                   </telerik:GridTableView>
               </DetailTables>
           </MasterTableView>
       </telerik:RadGrid>

My web service:

[WebMethod(true)]
public List<MockData> TestGetData()
{
    return GetInventoryData(new Random(DateTime.Now.Second));
}
 
private List<MockData> GetInventoryData(Random random)
{
 
    var list = new List<MockData>();
 
    for (int i = 0; i < 10; i++)
    {
        var mock = new MockData();
        mock.Name = "VC";
        mock.OS = "Ldd";
        mock.ArticleNumber = "123456";
        mock.SerialNumber = "654321";
        mock.Revision = "J";
        mock.ID = i;
        mock.parentID = null;
 
        var details = new List<DetailedMockData>();
 
        for (int j = 0; j < random.Next(0, 4); j++)
        {
            var mock2 = new DetailedMockData();
            mock2.MockData = new MockData();
            mock2.Test = "Hej Hej";
            mock2.MockData.Name = "dfd";
            mock2.MockData.OS = "Lff";
            mock2.MockData.ID = j + 100;
            mock2.MockData.parentID = mock.ID;
            details.Add(mock2);
        }
 
        mock.Details = details;
 
        list.Add(mock);
    }
 
    return list;
}

[Serializable]
public class MockData
{
    public string Name { get; set; }
    public string OS { get; set; }
    public string ArticleNumber { get; set; }
    public string SerialNumber { get; set; }
    public string Hardware { get; set; }
    public string Software { get; set; }
    public string Revision { get; set; }
    public int ID { get; set; }
    public int? parentID { get; set; }
 
    public List<DetailedMockData> Details { get; set; }
}
 
[Serializable]
public class DetailedMockData
{
    public string Test { get; set; }
 
    public MockData MockData { get; set; }
}


Shinu
Top achievements
Rank 2
 answered on 12 Nov 2012
1 answer
107 views
Hi,
I am using Radeditor, to retrieve the Content value of radeditor i make use of .get_html(true), when Postback occurs it generates the following error
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Thanks
Princy
Top achievements
Rank 2
 answered on 12 Nov 2012
1 answer
96 views
Hi,
when I right to left radgrid that it's column resize is enabled ,the column resize dont work correctly and the handlers work inverse
I mean when I drag handler to left side to expand grid column the column small 
Tanx
Omid
Top achievements
Rank 1
 answered on 11 Nov 2012
1 answer
108 views
Hi,

I have a RadCombobox on the page with checkboxes in it. This is to achieve multiple selection in my combobox. Depending on what the user selects i need to populate another combobox.
My issue is OnItemChecked event fires for every single selection. User would definitely not like this. I want the user to be able to finish all his selections and then fire an event to populate another combobox. Is there a solution for this?

Thanks.
Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?