Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
91 views
I have a grid where several columns sort on a sortexpression that is not the same as the datafield. If I click the column the sort cycles ascending, descding, no sort correctly and sorts on the field defined in the sortexpression. If I chose the ascending or descending sort options from the Context Header Menu, the colum sorts on the datafield. Is there a way to make the sort from the Filter Menu use the sortexpression field?
Angel Petrov
Telerik team
 answered on 19 Nov 2012
3 answers
210 views
Hello,

I want to bind a RadListBox to a list of a simple class:

Public Class ExampleInfo
    Property ID as integer
    Property Text as String
    Property Category as string
End Class

I would like to add separators to the list by category. Physically, that's easy - I just made the separator items disabled and applied a special css class. But, I am having trouble positioning them. Here's been my current approach:
Private _curCategory as string = ""
Private Sub mainList_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadListBoxItemEventArgs)
        Dim dataRow As ExampleInfo = DirectCast(e.Item.DataItem, ExampleInfo)
        Dim LocalCategory as string  = dataRow.Category
        If _curCateogry <> LocalCategory Then
            Dim sepItem As New RadListBoxItem(LocalCategory, 0)
            sepItem.Enabled = False
            sepItem.CssClass = "listSeparator"
            sepItem.Attributes.Add("isSeparator", "True")
            mainList.Items.Add(sepItem)
        End If
        e.Item.Attributes.Add("isSeparator", "False")
        e.Item.ToolTip = dataRow.Description
End Sub

This adds the items just fine but, of course, they are added below the first item in the new category. I tried reordering them in the DataBound event for the list but I haven't been able to get that to work.

Can anybody help - how can I add separator items?

Thanks,

Mike
Kate
Telerik team
 answered on 19 Nov 2012
1 answer
58 views

The following code is used to render a Grid with a nested grid, all Data is bound using NeedDataSource
The issues are as follows
1) there is no expand icon displayed
2) Master grid is reset when the child grid is displayed, the columns that were set using code behind are reset

So What I need is the following, The Delete row Icon is displayed only if the data has a Status of 'A'
If no delete icon is displayed the we will show a icon for Sucess or Failed or Processing

if the Status is Failed, then we should be able to expand the grid to see the errors listed, again if any other status then no expand to be displayed.

There are no internal styles to be used.

Mark up Code

<telerik:RadGrid
runat="server"
ID="RadGrid2"
EnableEmbeddedSkins="False"
ShowStatusBar="True"
AllowPaging="True"
AutoGenerateColumns="False"
CellSpacing="0"
width="795px" GridLines="None" >
<ActiveItemStyle CssClass="alternate" />
<MasterTableView >
<ExpandCollapseColumn
Visible="True"
CollapseImageUrl="~/Images/collapse-large-silver.png"
ExpandImageUrl="~/Images/expand-large-silver.png"
/>
<Columns>
<telerik:GridBoundColumn DataField="ImportHeaderID" Display="False" UniqueName="ImportHeaderID" Visible="False" />
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" HeaderStyle-Width="40px" ImageUrl="~/Images/icon-quick-link-delete.png" Text="Delete" UniqueName="DeleteColumn">
<HeaderStyle Width="40px" />
</telerik:GridButtonColumn>
<telerik:GridHyperLinkColumn AllowFiltering="False" DataNavigateUrlFields="ImportHeaderID" DataNavigateUrlFormatString="~/DisplayFile.aspx?HeaderID={0}" DataTextField="ImportHeaderFilename" HeaderStyle-Width="200px" HeaderText="Filename" Target="_blank" UniqueName="Filename">
<HeaderStyle Width="200px" />
</telerik:GridHyperLinkColumn>
<telerik:GridDateTimeColumn AllowFiltering="False" DataField="importHeaderFileLoadDate" HeaderStyle-Width="200px" HeaderText="Uploaded" ReadOnly="true" UniqueName="Uploaded">
<HeaderStyle Width="200px" />
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn AllowFiltering="False" DataField="importHeaderCreatedBy" HeaderStyle-Width="200px" HeaderText="CreatedBy" ReadOnly="true" UniqueName="CreatedBy">
<HeaderStyle Width="200px" />
</telerik:GridBoundColumn>
</Columns>
<NestedViewTemplate>
<asp:Panel ID="Errors" runat="server">
<telerik:RadGrid ID="ErrorGrid"
runat="server"
EnableEmbeddedSkins="False"
ShowStatusBar="True"
AllowPaging="True"
AutoGenerateColumns="False"
CellSpacing="0"
ShowHeader="False">
<MasterTableView Name="inner">
<Columns>
<telerik:GridBoundColumn DataField="ErrorDescription" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
</asp:Panel>
</NestedViewTemplate>
<NoRecordsTemplate>
<div>Please select filter Settings from above</div>
</NoRecordsTemplate>
</MasterTableView>
<HeaderContextMenu EnableEmbeddedSkins="False"></HeaderContextMenu>
</telerik:RadGrid>

Code behind

Protected Sub RadGrid2_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles RadGrid2.NeedDataSource
Dim ds As DataSet = DAL.DAL.SelectImportedFiles(0)
RadGrid2.DataSource = ds
End Sub
Protected Sub RadGrid2_ItemCreated(sender As Object, e As GridItemEventArgs) Handles RadGrid2.ItemCreated
If TypeOf e.Item Is GridNestedViewItem Then
AddHandler TryCast(e.Item.FindControl("ErrorGrid"), RadGrid).NeedDataSource, AddressOf Me.ErrorGrid_NeedDataSource
End If
End Sub
Protected Sub ErrorGrid_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs)
Dim nestedItem As GridNestedViewItem = DirectCast(TryCast(sender, RadGrid).NamingContainer, GridNestedViewItem)
Dim dataKeyValue As String = nestedItem.ParentItem.Item("ImportHeaderID").Text
If IsNumeric(dataKeyValue) Then
Dim ds As DataSet = DAL.DAL.SelectImportedErrors(CInt(dataKeyValue))
CType(sender, RadGrid).DataSource = ds
End If
End Sub
Private Sub RadGrid2_ItemCommand(source As Object, e As GridCommandEventArgs) Handles RadGrid2.ItemCommand
If e.CommandName = RadGrid.ExpandCollapseCommandName Then
Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
If Not item.Expanded Then
Dim nestedItem As GridNestedViewItem = DirectCast(item.ChildItem, GridNestedViewItem)
Dim tempGrid As RadGrid = DirectCast(nestedItem.FindControl("ErrorGrid"), RadGrid)
tempGrid.Rebind()
End If
End If
End Sub
Protected Sub RadGrid2_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid2.ItemDataBound
If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = GridItemType.Item Then
Dim ds As DataSet = TryCast(RadGrid2.DataSource, DataSet)
If ds.Tables(0).Rows(DirectCast(e.Item, Telerik.Web.UI.GridDataItem).DataSetIndex)("ImportHeaderState") <> "A" Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim cellDelete As TableCell = item("DeleteColumn")
cellDelete.Controls.Clear()
Dim img As New Image
Select Case ds.Tables(0).Rows(DirectCast(e.Item, Telerik.Web.UI.GridDataItem).DataSetIndex)("ImportHeaderState")
Case "P"
img.ImageUrl = "~/images/icon-notification-box.gif"
Case "S"
img.ImageUrl = "~/images/icon-notice-box.png"
Case "F"
img.ImageUrl = "~/images/icon_status_fail_26x26.gif"
End Select
cellDelete.Controls.Add(img)
End If
If ds.Tables(0).Rows(DirectCast(e.Item, Telerik.Web.UI.GridDataItem).DataSetIndex)("ImportHeaderState") <> "F" Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim cellExpand As TableCell = item("ExpandColumn")
cellExpand.Controls.Clear()
End If
End If
End Sub
Eyup
Telerik team
 answered on 19 Nov 2012
1 answer
156 views
Hi,

It is possible to populate a RadCombobox or other Telerik controls suing client side code and a REST API. I can usin code behind and make a request to the WEB API however I would like to do everything on client side
Boyan Dimitrov
Telerik team
 answered on 19 Nov 2012
10 answers
2.7K+ views

Hi,
i am using radcombobox and one scenrio i want that combobox having value from other sources which is working but i want that value to be shown as selected when page load not the user has to click the dropdown to see the value.

how to set the default value selected in dropdown. please help.

 <telerik:RadComboBox ID="cboTaskPersonSelector" runat="server" Width="195px" Height="150px"
                                    style="z-index: 107; left: 470px; position: absolute; top: 45px;"
                                    EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                    EnableVirtualScrolling="true" OnItemsRequested="cboTaskPersonSelector_ItemsRequested"
                                    Skin="Web20" AllowCustomText="false" EnableTextSelection="true" IsCaseSensitive="false"
                                    LoadingMessage="Loading..." DropDownWidth="500px" EnableScreenBoundaryDetection="true"
                                    Font-Names="Tahoma" Font-Size="12px" Enabled="false"
                                    OnClientDropDownClosed="OnClientBlur" ShowDropDownOnTextboxClick="false"
                                    AutoPostBack="true"
                                    OnSelectedIndexChanged="cboTaskPersonSelector_SelectedIndexChanged" SelectedValue='<%# Bind("TaskPersonId") %>'
                                    >

                                </telerik:RadComboBox>

protected void cboTaskPersonSelector_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    { 
            if (e.Text.Length > 0)
            {
                t = TaskInfoCollection.SearchPossibleTasksForAllotmentByTitleOrNumber(e.Text);

                for (int i = itemOffset; i < endOffset; i++)
                {
                    ctl.Items.Add(new RadComboBoxItem(t[i].Number.ToString(), t[i].Id.ToString()));
                }
               
            }
            else if (Request.QueryString["popup"] != null)
            {
                               
                t = TaskInfoCollection.SearchPossibleTasksForAllotmentByTitleOrNumber(Request.QueryString["taskno"]);

                     for (int i = itemOffset; i < endOffset; i++)
                {
                    ctl.Items.Add(new RadComboBoxItem(t[i].Number.ToString(), t[i].Id.ToString()));
                }              
               
            }
        }    
    }

here the value is fill into combo box by  ctl.Items.Add() but it is not showing as selected value.
so when page load it look likes the dropdown is empty while when user click on dropdown it is there.

please help.
Cat Cheshire
Top achievements
Rank 1
 answered on 19 Nov 2012
8 answers
235 views
Hi,

I have created a simple uploader that I am using to upload and process files.
I am using a ProgressArea for custom use, to show the progress of the file processing and not the file uploading.

On my develment server it is working fine, but after publish to my webserver it is not working.
The area shows, but the bars stay empty and the information shown is not updated in any way.

You can test my Progress Area using the following link: http://diesel.persies.nl
Just get this file, and upload it in te site above. and you will see what happens (or doesn't).

What could be wrong?

P.S. i am using a trial version at the moment, but I do not beleive that has anything to do with the problem.
Peter Filipov
Telerik team
 answered on 19 Nov 2012
0 answers
91 views

I am using Telerik RadGrid. It's search functionality work great whilst you are using English. When you have some Arabic text its search won't work

I have resolved the issue. It was not specfic with RAD Grid. Sorry
ABC
Top achievements
Rank 1
 asked on 19 Nov 2012
1 answer
152 views
Hi telerik,

I want to edit a row in my RadGrid on simply clicking the row. I don't want to use AutoGeneratedEditColumn or edit command column.
Please help ASAP..

Regards...
Princy
Top achievements
Rank 2
 answered on 19 Nov 2012
1 answer
124 views
Hi telerik,

My RadGrid has paging and sorting enabled. I am using add new record button to insert in my RadGrid. I am also using automatic crud operations. But my inserted rows are showing in the last row of the RadGrid. I want to show it in the current page itself. Please help me to achieve this scenario.

Thanks in advance.........
Shinu
Top achievements
Rank 2
 answered on 19 Nov 2012
2 answers
198 views
hi, kindly help me ,i have 2 datepickers and set min date and max date ,it works fine ,
now when one of them make error ex. out of range then the date input take the error style ,that's great 
but when clear the the dates by clicking a clear button  the error style still appear ,
if i removed it by jquery ,it's appear again on mouse over event ,
how to clear date picker event it takes error style ?
i used the following function and it's work fine but with IE the popup calender still appear .why ?????
 //clear Add Holding Event Inputs
                function fnClearHoldingEventInputs(sender, args) {
                    
                    rdpEventStartDate.set_maxDate(maxDate);
                    rdpEventEndDate.set_minDate(minDate);
                    rdpEventStartDate.clear();
                    rdpEventStartDate.get_dateInput().clear();
                    rdpEventEndDate.clear();
                    rdpEventEndDate.get_dateInput().clear();
                    $('.riTextBox').val('');
                    //to remove error class from raddatepicker UI bug
                    $('.riError').removeClass('riError');
                    rdpEventStartDate.set_showPopupOnFocus(false);
                    rdpEventEndDate.set_showPopupOnFocus(false);
                    rdpEventStartDate.get_dateInput().focus();
                    rdpEventEndDate.get_dateInput().focus();
                    rdpEventStartDate.hidePopup();
                    rdpEventEndDate.hidePopup();
                    rdpEventStartDate.set_showPopupOnFocus(true);
                    rdpEventEndDate.set_showPopupOnFocus(true);
}
Ashraf
Top achievements
Rank 2
 answered on 19 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?