Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
233 views
I have a fairly simple page that contains a DropDownList control and a DetailsView control in a master/details type setup.

The DetailsView displays the details of the record selected in the DropDownList.

This form works perfectly without RadAjaxManager.

However, as soon as I hook up the RadAjaxManager I get errors in the code.

Troubleshooting the issue I was able to determine that the DetailsView.DataBound event is being triggered BEFORE the DropDownList.DataBound event. Code in the DetailsView.DataBound event populates a control within the DetailsView with data associated with the currently selected item in the DropDownList. But an error occurs because there is no DropDownList.SelectedValue because the DropDownList control hasn't been databound yet.

As I said, this does not occur when RadAjaxManager is not on the page.

What do I need to set in RadAjaxManager to make sure that the controls get bound in the correct order? (top-down)

Note I've hooked up event handlers for DetailsView.ModeChanged and DetailsView.DataBound. Also note I've hooked up the DropDownList.PreRender event as well with the following code:

CType(sender, DropDownList).Attributes.Add("onChange", "window.focus();")


I need to have this code because the user may use his mouse wheel to scroll the page, but if the DropDownList is selected it will scroll that instead and reload the DetailsView.

Iana Tsolova
Telerik team
 answered on 27 Oct 2011
1 answer
152 views
Hi,

Are there any events on the client side which fire when a new page is requested from the grid for which I can write javascript code to handle?

The reason that I ask is that I have a grid with client-side binding and caching enabled. This works pretty much as I would expect except that when you go to a page which is cached the RadAjaxLoadingPanel isn't shown and I would really like to show it and hide it again for the cached pages as it is great indicator as to whether something is going on.

Stuart
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
654 views
I am working with the RadWindow, and an objective is to close the RadWindow once a navigateUrl is applied to a HyperLink;
 
The issue is with the close of the RadWindow, and how best to close the RadWindow programmatically with C# and/or JavaScript;

Thank in advance for any insight;  Best regards - Rob 

 
Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
144 views
I have successfully tested this feature on my dev and live server on multiple browsers on my machine. However the user is receiving the attached screen. The user is using Internet Explorer, although not sure which version at this time.

I used an ImageButton for the export button.
protected void exportToExcel_Click(object sender, ImageClickEventArgs e) {
          radGridVesselUtil.ExportSettings.IgnorePaging = true;
          radGridVesselUtil.ExportSettings.OpenInNewWindow = true;
          radGridVesselUtil.ExportSettings.ExportOnlyData = true;
          radGridVesselUtil.ExportSettings.FileName = "vessel_util_" + DateTime.Now.ToShortDateString();
          radGridVesselUtil.MasterTableView.ExportToExcel();
      }
 protected void gridDpSummary_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) {
                gridDpSummary.DataSource = SqlDataSource1;
            }


RadGridMarkup

                    
                       <telerik:RadGrid ID="radGridVesselUtil" runat="server" CellSpacing="0"
                         AllowPaging="True" AllowSorting="True" PageSize="25"
                       GridLines="None" EnableEmbeddedSkins="False" Skin="dpgrid"
                         ShowGroupPanel="True" AutoGenerateColumns="False" 
                         onneeddatasource="radGridVesselUtil_NeedDataSource">
                             <MasterTableView>
                               <CommandItemSettings ShowExportToExcelButton="true"></CommandItemSettings>
                               <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                               <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                               <Columns>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Voyage Column"
                                   HeaderText="Voyage" UniqueName="Voyage" DataField="VoyageID">
                                   <HeaderStyle Width="55px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Leg Start Column"
                                   UniqueName="LegStart" HeaderText="Start Date" DataField="LegStart">
                                   <HeaderStyle Width="125px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Leg End Column"
                                   UniqueName="LegEnd" HeaderText="End Date" DataField="LegEnd">
                                   <HeaderStyle Width="125px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Vessel Column"
                                   UniqueName="VesselName" HeaderText="Vessel" DataField="VesselName">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Facility Column"
                                   UniqueName="FacilityName" HeaderText="Facility" DataField="FacilityName">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Time Usage column"
                                   HeaderText="Time Usage" UniqueName="TimeUsage" DataField="TimeUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Volume Usage column"
                                   HeaderText="Volume Usage" UniqueName="VolumeUsage" DataField="VolumeUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Weight column"
                                   HeaderText="Weight" UniqueName="Weight" DataField="Weight">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Capacity Usage Column"
                                   HeaderText="Capacity Usage" UniqueName="CapacityUsage" DataField="CapacityUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Deck Space Usage Column"
                                   HeaderText="Deck Space Usage" UniqueName="DeckSpaceUsage" DataField="DeckSpaceUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                               </Columns>
                               <EditFormSettings>
                               <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif" CancelImageUrl="Cancel.gif" FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                               </EditFormSettings>
                               <GroupByExpressions>
                                 <telerik:GridGroupByExpression>
                                   <SelectFields>
                                     <telerik:GridGroupByField FieldName="VoyageID" HeaderText="Voyage" />
                                   </SelectFields>
                                   <GroupByFields>
                                     <telerik:GridGroupByField FieldName="VoyageID" SortOrder="Descending" />
                                   </GroupByFields>
                                 </telerik:GridGroupByExpression>
                               </GroupByExpressions>
                             </MasterTableView>
                              <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                             <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                              <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                                 ResizeGridOnColumnResize="False"></Resizing>
                             </ClientSettings>
                              <GroupingSettings ShowUnGroupButton="true"/>
                              <FilterMenu EnableImageSprites="False"></FilterMenu>
                              <HeaderContextMenu EnableEmbeddedSkins="False" CssClass="GridContextMenu GridContextMenu_dpgrid"></HeaderContextMenu>
                       </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
3 answers
199 views
I have a radgrid where I want to put two columns under a header.  I am attaching a screenshot to this thread to show you what I want.  You will see the column "Open Items by Age" is further divided as "Prior" and "Current" columns.  Is this possible to do in a radgrid and still maintain the sort for the "Prior" and "Current" columns.  I am attaching code to help you see my grid.

Thanks in advance!


<telerik:RadGrid ID="grdCurrentandPrior" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        GridLines="Horizontal" Skin="Web20" Style="margin-right: 0px" Width="897px" Height="252px"
                        OnNeedDataSource="grdCurrentandPrior_NeedDataSource" OnExcelMLExportRowCreated="grdCurrentandPrior_ExcelMLExportRowCreated" OnSortCommand="grdCurrentandPrior_SortCommand">
                        <ExportSettings FileName="OpenItemsCurrentInventory" IgnorePaging="True" OpenInNewWindow="True"
                            ExportOnlyData="true" Excel-Format="ExcelML">
                        </ExportSettings>
                        <MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false" UseAllDataFields="true">
                            <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                                ShowRefreshButton="false" />
                            <Columns>
                                <telerik:GridTemplateColumn DataField="Assignee" HeaderText="Assignee" UniqueName="Assignee"
                                    SortExpression="Assignee">
                                    <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbAssignee" runat="server" Text='<%# Eval("Assignee") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="State" HeaderText="State" UniqueName="State"
                                    SortExpression="State" Visible="false">
                                    <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="JurisdictionCount" HeaderText="Jurisdictions"
                                    UniqueName="JurisdictionCount" SortExpression="JurisdictionCount">
                                    <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbJurisdiction" runat="server" Text='<%# Eval("JurisdictionCount", "{0:N0}")%>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="OpenItemsCountPrior" HeaderText="Prior Open Items"
                                    UniqueName="OpenItemsCountPrior" SortExpression="OpenItemsCountPrior">
                                    <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbPrior" runat="server" Text='<%# Eval("OpenItemsCountPrior", "{0:N0}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="OpenItemsCountLastMonth" HeaderText="Last Month Items"
                                    UniqueName="OpenItemsCountLastMonth" SortExpression="OpenItemsCountLastMonth">
                                    <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbLastMonth" runat="server" Text='<%# Eval("OpenItemsCountLastMonth", "{0:N0}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="OpenItemsCountCurrent" HeaderText="Current Open Items"
                                    UniqueName="OpenItemsCountCurrent" SortExpression="OpenItemsCountCurrent">
                                    <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lbCurrent" runat="server" Text='<%# Eval("OpenItemsCountCurrent", "{0:N0}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="TotalRemainingItems" HeaderText="Items Left to Pay"
                                    UniqueName="TotalRemainingItems" SortExpression="TotalRemainingItems">
                                    <HeaderStyle Font-Bold="True" Width="95px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblTotalRemain" runat="server" Text='<%# Eval("TotalRemainingItems", "{0:N0}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="CompleteCount" HeaderText="Complete"
                                    UniqueName="CompleteCount" SortExpression="CompleteCount">
                                    <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblCompleteCount" runat="server" Text='<%# Eval("CompleteCount", "{0:N0}") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="clmPctComplete"
                                    SortExpression="PercentComplete">
                                    <HeaderStyle Font-Bold="True" Width="85px" HorizontalAlign="Center" Font-Names="Arial" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("PercentComplete", "{0:N2}%")%>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey"
                                    Visible="False">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <HeaderStyle BorderStyle="Solid" />
                        <ClientSettings>
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                        </ClientSettings>
                    </telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
114 views
Greetings,

For various reasons i had to add data to my grid outside the grid itself (no use of Edit,Delete buttom)
Therefore when i make a query the grid does not refresh...
How could i make this ?

Thanks in advance
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
214 views
I'm writing to ask if there are examples of utilizing the hide method of the RadWindow - to make the RadWindow invisible;

Thanks in advance for any insight;  Best regards - Rob
Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
151 views
Hi Telerik team,
actually we are evaluating the trial version of the ajax suite.
we'd like to hide the button (se attach file)

how can we achived this ?

thank you very much

Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
105 views
I am having an issue on multiple pages with the RadDatePicker.  If the user uses the Calendar and selects a date there is no issue, but about 35% of the time if the user manually enters the date byt typing it in it does not recognize the date as the selected date.  I am using version 2009.3.1314.35.

<telerik:RadDatePicker ID="dpMeetingDate" runat="server" MinDate="2009-01-01" Width="150px" ImagesPath="" Skin="Vista" Enabled="false">
        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" Skin="Vista"  />
        <DatePopupButton ImageUrl="" HoverImageUrl="" />
</telerik:RadDatePicker>

when I try to save or sometimes try to filter by looking at the date entered if the user has manually entered it I get the error that no date was selected.

if (dpMeetingDate.SelectedDate == null)
{
  lblError.Text += "<br>  - Select a meeting date";
  canSave = false;
}
Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
132 views
Hey, how can i hide a hierarchy column in a radgrid from the server side (VB.NET)?

Depending on authorisation, for exemple if a checkbox is checked.
(Not working)
if mycheckbox.checked = true then
    radgrid1.columns(0).display = false
    radgrid1.columns(0).visible = false
End if

(working, only hide the arrow in the hierarchy column)

Dim

 

 

 numberoflines As Integer = radgrid1.Items.Count

 

 

 

For i = 0 To numberoflines - 1

 

radgrid1.Items(i).Cells(0).Controls(0).Visible =

 

False

 

 

 

Next i

 


I need to hide the column because the waste of space in the grid.
I dont want to make another radgrid in copy without the detailtable and call:
if mycheckbox.checked = true then
    radgrid1.visible = true
    radgrid2.visible = false
else
    radgrid1.visible = false
    radgrid2.visible = true
End if

How can i hide the column(0) of the radgrid in the server side?

TY for your reply


Shinu
Top achievements
Rank 2
 answered on 27 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?