Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
87 views
Dear Sir,
The requirement is that there are s two buttons (Retrieve and Apply) and one updatepanel. When user clicked the "Retrieve" button, the grid will be populated by search filter (No a grid filter). After that user selected those row for "Approval" button. There is working table to generated the record for this page by session id
It is expected that when the "Apply" button is clicked, the working table field -"TICK" to be updated automatically. However, the 'TICK' didn't update. Please help
<telerik:radgrid id="rgdApproval" runat="server" autogeneratecolumns="False" cellspacing="0"
cssclass="NoPadding" gridlines="Vertical" groupingenabled="False" height=" 200px" width="98%"  ShowHeader="true"
AllowAutomaticUpdates="True"  onitemcommand="rgdApproval_ItemCommand"
AllowMultiRowSelection="true" >
<AlternatingItemStyle BackColor="#DCE6F1" Font-Names="Verdana" Font-Size="9pt"
Height="20px" />
<MasterTableView AllowMultiColumnSorting="false"  EditMode="Batch"
ClientDataKeyNames="EACCAPV_DOCNO" Summary="RadGrid table"
TableLayout="Fixed" 
Width="100%">
                       <PagerStyle AlwaysVisible="true" />
                                            <Columns>
                                               
                                               <telerik:GridClientSelectColumn  UniqueName="chkTick"  DataType ="System.Boolean" Display="true"  >
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="50px" />
                                                        <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="50px" />
                                                </telerik:GridClientSelectColumn>
                                                <telerik:GridCheckBoxColumn     ReadOnly ="true" HeaderText="Out Pay"
                                                                                UniqueName="chkOUTPAY">
                                                         <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="60px" />
                                                         <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="60px" />
                                                </telerik:GridCheckBoxColumn>
                                                <telerik:GridBoundColumn ReadOnly ="true" DataField ="EACCAPV_OUTSIDEPAY"
                                                                         Visible ="false" HeaderText=""
                                                                         UniqueName="OUTSIDEPAY">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn
                                                             HeaderText="Document No" UniqueName="grvDocumentNo">
                                                             <ItemTemplate>
                                                                 <asp:LinkButton ID="LnkEACCAPV_DOCNO" runat="server"
                                                                     CommandArgument="<%#Container.ItemIndex%>" CommandName="ViewDocNo"
                                                                     Text='<%# Bind("EACCAPV_DOCNO") %>'></asp:LinkButton>
                                                             </ItemTemplate>
                                                             <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="135px" />
                                                             <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="135px" />
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                            <GroupByExpressions>
                                                <telerik:GridGroupByExpression>
                                                     <GroupByFields>
                                                            <telerik:GridGroupByField FieldName="EACCAPV_CLMCCY"></telerik:GridGroupByField>
                                                     </GroupByFields>
                                                    <SelectFields>
                                                        <telerik:GridGroupByField FieldName="EACCAPV_CLMCCY" HeaderText=""></telerik:GridGroupByField>
                                                    </SelectFields>
                                                </telerik:GridGroupByExpression>
                                            </GroupByExpressions>
                                        </MasterTableView>
                                        <SortingSettings EnableSkinSortStyles="False" SortedBackColor="Azure" />
                                         <ClientSettings EnableRowHoverStyle="true"  >
                                             <Resizing AllowColumnResize="True" AllowRowResize="False"
                                                 EnableRealTimeResize="True" ResizeGridOnColumnResize="False" />
                                             <Selecting AllowRowSelect="True"    />
                                             <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                         </ClientSettings>
                                        <PagerStyle Height="20px" />
                                    </telerik:radgrid>
<telerik:radgrid id="rgdApproval" runat="server" autogeneratecolumns="False" cellspacing="0"
                                        cssclass="NoPadding" gridlines="Vertical" groupingenabled="False" height=" 200px" width="98%"  ShowHeader="true"
                                       AllowAutomaticUpdates="True"  onitemcommand="rgdApproval_ItemCommand"
                                         AllowMultiRowSelection="true" >
                                        <AlternatingItemStyle BackColor="#DCE6F1" Font-Names="Verdana" Font-Size="9pt"
                                                                Height="20px" />
                                        <MasterTableView AllowMultiColumnSorting="false"  EditMode="Batch"
                                                          ClientDataKeyNames="EACCAPV_DOCNO" Summary="RadGrid table"
                                                          TableLayout="Fixed"
                                                         Width="100%">
                                            <PagerStyle AlwaysVisible="true" />
                                            <Columns>
                                                
                                               <telerik:GridClientSelectColumn  UniqueName="chkTick"  DataType ="System.Boolean" Display="true"  >
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="50px" />
                                                        <ItemStyle HorizontalAlign="left" VerticalAlign="Middle" Width="50px" />
                                                </telerik:GridClientSelectColumn>
                                                <telerik:GridCheckBoxColumn     ReadOnly ="true" HeaderText="Out Pay"
                                                                                UniqueName="chkOUTPAY">
                                                         <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="60px" />
                                                         <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="60px" />
                                                </telerik:GridCheckBoxColumn>
                                                <telerik:GridBoundColumn ReadOnly ="true" DataField ="EACCAPV_OUTSIDEPAY"
                                                                         Visible ="false" HeaderText=""
                                                                         UniqueName="OUTSIDEPAY">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn
                                                             HeaderText="Document No" UniqueName="grvDocumentNo">
                                                             <ItemTemplate>
                                                                 <asp:LinkButton ID="LnkEACCAPV_DOCNO" runat="server"
                                                                     CommandArgument="<%#Container.ItemIndex%>" CommandName="ViewDocNo"
                                                                     Text='<%# Bind("EACCAPV_DOCNO") %>'></asp:LinkButton>
                                                             </ItemTemplate>
                                                             <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="135px" />
                                                             <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="135px" />
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                            <GroupByExpressions>
                                                <telerik:GridGroupByExpression>
                                                     <GroupByFields>
                                                            <telerik:GridGroupByField FieldName="EACCAPV_CLMCCY"></telerik:GridGroupByField>
                                                     </GroupByFields>
                                                    <SelectFields>
                                                        <telerik:GridGroupByField FieldName="EACCAPV_CLMCCY" HeaderText=""></telerik:GridGroupByField>
                                                    </SelectFields>
                                                </telerik:GridGroupByExpression>
                                            </GroupByExpressions>
                                        </MasterTableView>
                                        <SortingSettings EnableSkinSortStyles="False" SortedBackColor="Azure" />
                                         <ClientSettings EnableRowHoverStyle="true"  >
                                             <Resizing AllowColumnResize="True" AllowRowResize="False"
                                                 EnableRealTimeResize="True" ResizeGridOnColumnResize="False" />
                                             <Selecting AllowRowSelect="True"    />
                                             <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                         </ClientSettings>
                                        <PagerStyle Height="20px" />
                                    </telerik:radgrid>

Best Regards,
Judy Wong
Konstantin Dikov
Telerik team
 answered on 20 Dec 2013
9 answers
403 views

Hi,

I have a RadGrid that binds using NeedDataSource. The NeedDataSource calls a tableadapter that uses a combobox SelectedValue as an input parameter. So the grid is populated based on the SelectedValue.

That works fine when the page first loads. Though I am having issues with when I change a combobox SelectedValue.

I believe it is a matter of the event ordering. As in the NeedDataSource kicks off BEFORE the SelectedIndexChanged is fired.

Below is my RadGrid:


<telerik:RadGrid ID="RDHauls" runat="server" AutoGenerateEditColumn="True" GridLines="Horizontal" AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#ecf3f4" BorderColor="#28899A" EditItemStyle-BackColor="#009999" EditItemStyle-Font-Bold="true" OnItemDataBound="RDHauls_ItemDataBound" OnItemCreated="RDHauls_ItemCreated" OnNeedDataSource="RDHauls_NeedDataSource" CssClass="Radgrid">
          <AlternatingItemStyle BackColor="#ECF3F4"></AlternatingItemStyle>
          <HeaderStyle BorderColor="#28899A" Font-Bold="True" Font-Size="12px" Font-Names="Verdana" />
             <MasterTableView EnableViewState="false">
                   <Columns>
                       <telerik:GridBoundColumn DataField="TripCode" FilterControlAltText="Filter TripCode column" HeaderText="Trip Code" SortExpression="TripCode" UniqueName="TripCode" ReadOnly="true"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="VessReg"  FilterControlAltText="Filter VessReg column" HeaderText="Vessel" SortExpression="VessReg" UniqueName="VessReg" ReadOnly="true"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HaulNumber" HeaderText="Haul" UniqueName="HaulNumber" ReadOnly="true"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="RigNumber" HeaderText="Rig"  UniqueName="RigNumber" ReadOnly="true"></telerik:GridBoundColumn>
                       <telerik:GridDropDownColumn DataField="Technique" HeaderText="Technique" ListTextField="Name" ListValueField="Code" UniqueName="Technique" ColumnEditorID="Technique" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>
                       <telerik:GridCheckBoxColumn DataField="HaulSampledTrueFalse" HeaderText="Haul Sampled?" Visible="false" UniqueName="HaulSampledTrueFalse" ColumnEditorID="HaulSampled"></telerik:GridCheckBoxColumn>
                       <telerik:GridCheckBoxColumn DataField="TowDisruptedTrueFalse" HeaderText="Tow Disrupted?" Visible="false" UniqueName="TowDisruptedTrueFalse"></telerik:GridCheckBoxColumn>
                       <telerik:GridBoundColumn DataField="CodEnd" HeaderText="Cod End (mm)" UniqueName="CodEnd" ColumnEditorID="CodEnd" Visible="false" ConvertEmptyStringToNull="true"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="MeshSize" HeaderText="Mesh Size (mm)" UniqueName="MeshSize" Visible="false"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="SelectivityMesh" HeaderText="Selectivity Mesh (mm)" UniqueName="SelectivityMesh" Visible="false"></telerik:GridBoundColumn>                
                       <telerik:GridDropDownColumn DataField="TwineCode" HeaderText="Twine" ListTextField="Name" ListValueField="Code" UniqueName="TwineCode" ColumnEditorID="TwineCode" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>                     
                       <telerik:GridBoundColumn DataField="TwineThickness" HeaderText="Twine Thickness (mm)" UniqueName="TwineThickness" Visible="false" DataType="System.Decimal"></telerik:GridBoundColumn>
                       <telerik:GridDropDownColumn DataField="GroundGear" HeaderText="Ground Gear" ListTextField="Name" ListValueField="Code" UniqueName="GroundGear" ColumnEditorID="GroundGear" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>  
                       <telerik:GridBoundColumn DataField="Bridal" HeaderText="Bridal (m)" UniqueName="Bridal" Visible="false" DataType="System.Int32"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HeadlineHeight" HeaderText="Headline Height (m)" UniqueName="HeadlineHeight" Visible="false"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="WarpLength" HeaderText="Warp Length (fath)" UniqueName="WarpLength" Visible="false"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="DoorSpread" HeaderText="Door Spread (m)" UniqueName="DoorSpread" Visible="false"></telerik:GridBoundColumn>
                       <telerik:GridDropDownColumn DataField="TidalStateCode" HeaderText="Tidal State" ListTextField="Name" ListValueField="Code" UniqueName="TidalStateCode" ColumnEditorID="TidalStateCode" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>     
                       <telerik:GridDropDownColumn DataField="TidalStrengthCode" HeaderText="Tidal Strength" ListTextField="Name" ListValueField="Code" UniqueName="TidalStrengthCode" ColumnEditorID="TidalStrengthCode" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>                 
                       <telerik:GridDropDownColumn DataField="TidalDirectionCode" HeaderText="Tidal Direction" ListTextField="Name" ListValueField="Code" UniqueName="TidalDirectionCode" ColumnEditorID="TidalDirectionCode" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn
                       <telerik:GridBoundColumn DataField="GroundSpeed" HeaderText="Speed Over Ground (kts)" UniqueName="GroundSpeed" Visible="false" DataType="System.Decimal"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="ShotDate" HeaderText="Shot Date" UniqueName="ShotDate" Visible="false">
                        <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFShotDate" Font-Bold="True"> Enter Shot date</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridDropDownColumn DataField="ShotTime" HeaderText="Shot Time" ListTextField="vchTime" ListValueField="vchTime" UniqueName="ShotTime" ColumnEditorID="ShotTime" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn
                       <telerik:GridBoundColumn DataField="ShotDepth" HeaderText="Shot Depth (fath)" UniqueName="ShotDepth" Visible="false" DataType="System.Decimal"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="ShotLatd" HeaderText="Shot Latitude (deg)" UniqueName="ShotLatd" Visible="false">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFShotLatitudeD" Font-Bold="True"> Enter Shot Latitude (deg)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="ShotLatm" HeaderText="Shot Latitude (min)" UniqueName="ShotLatm" Visible="false">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFShotLatitudeM" Font-Bold="True"> Enter Shot Latitude (min)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="ShotLond" HeaderText="Shot Longitude (deg)" UniqueName="ShotLond" Visible="false">
                         <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFShotLongitudeD" Font-Bold="True"> Enter Shot Longitude (deg)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="ShotLonm" HeaderText="Shot Longitude (min)" UniqueName="ShotLonm" Visible="false">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFShotLongitudeM" Font-Bold="True"> Enter Shot Longitude (min)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridTemplateColumn UniqueName="ShotEastWest" ColumnEditorID="ShotEastWest" HeaderText="Shot East/West" Visible="false">
                           <ItemTemplate>
                               <%# Eval("ShotEW")%>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <asp:RadioButtonList ID="rdShotEastWest" runat="server" RepeatDirection="Horizontal"
                                  <asp:ListItem Text="East" Value="2"></asp:ListItem>
                                  <asp:ListItem Text="West" Value="1"></asp:ListItem>
                               </asp:RadioButtonList>
                           </EditItemTemplate>
                       </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="HaulDate" HeaderText="Haul Date" UniqueName="HaulDate" Visible="false">
                            <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFHaulDate" Font-Bold="True"> Enter Haul date</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridDropDownColumn DataField="HaulTime" HeaderText="Haul Time" ListTextField="vchTime" ListValueField="vchTime" UniqueName="HaulTime" ColumnEditorID="HaulTime" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>   
                       <telerik:GridBoundColumn DataField="HaulDepth" HeaderText="Haul Depth (fath)" UniqueName="HaulDepth" Visible="false" DataType="System.Decimal"></telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HaulLatd" HeaderText="Haul Latitude (deg)" UniqueName="HaulLatd" Visible="false">
                         <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFHaulLatitudeD" Font-Bold="True"> Enter Haul Latitude (deg)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HaulLatm" HeaderText="Haul Latitude (min)" UniqueName="HaulLatm" Visible="false">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFHaulLatitudeM" Font-Bold="True"> Enter Haul Latitude (min)</RequiredFieldValidator>
                            </ColumnValidationSettings>                       
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HaulLond" HeaderText="Haul Longitude (deg)" UniqueName="HaulLond" Visible="false">
                           <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFHaulLongitudeD" Font-Bold="True"> Enter Haul Longitude (deg)</RequiredFieldValidator>
                            </ColumnValidationSettings>    
                       </telerik:GridBoundColumn>
                       <telerik:GridBoundColumn DataField="HaulLonm" HeaderText="Haul Longitude (min)" UniqueName="HaulLonm" Visible="false">
                          <ColumnValidationSettings EnableRequiredFieldValidation="True">
                                <RequiredFieldValidator ID="RFHaulLongitudeM" Font-Bold="True"> Enter Haul Longitude (min)</RequiredFieldValidator>
                            </ColumnValidationSettings>
                       </telerik:GridBoundColumn>
                       <telerik:GridTemplateColumn UniqueName="HaulEastWest" ColumnEditorID="HaulEastWest" HeaderText="Haul East/West" Visible="false">
                           <ItemTemplate>
                               <%# Eval("HaulEW")%>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <asp:RadioButtonList ID="rdHaulEastWest" runat="server" RepeatDirection="Horizontal">
                                   <asp:ListItem Text="East" Value="2"></asp:ListItem>
                                   <asp:ListItem Text="West" Value="1"></asp:ListItem>
                               </asp:RadioButtonList>
                           </EditItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridDropDownColumn DataField="TowRegion" HeaderText="Tow Region" ListTextField="Name" ListValueField="Name" UniqueName="TowRegion" ColumnEditorID="TowRegion" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>
                       <telerik:GridDropDownColumn DataField="HaulRectangle" HeaderText="Haul Rectangle" ListTextField="Code" ListValueField="Code" UniqueName="HaulRectangle" ColumnEditorID="HaulRectangle" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn
                       <telerik:GridDropDownColumn DataField="WindSpeedCode" HeaderText="Wind Speed" ListTextField="Name" ListValueField="Code" UniqueName="WindSpeed" ColumnEditorID="WindSpeed" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>                   
                       <telerik:GridDropDownColumn DataField="WindDirectionCode" HeaderText="Wind Direction" ListTextField="Name" ListValueField="Code" UniqueName="WindDirection" ColumnEditorID="WindDirection" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>
                       <telerik:GridDropDownColumn DataField="SeaStateCode" HeaderText="Sea State" ListTextField="Name" ListValueField="Code" UniqueName="SeaState" ColumnEditorID="SeaState" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>   
                       <telerik:GridDropDownColumn DataField="SelectivityDeviceCode" HeaderText="Selectivity Device" ListTextField="nvcSelectivityDeviceName" ListValueField="intSelectivityDeviceID" UniqueName="SelectivityDevice" Visible="false" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>                
                    </Columns>
                  </MasterTableView>
              </telerik:RadGrid>

And the table that contains the comboboxes is as follows:

<table class="tbldialog" id="Table1" cellspacing="1" cellpadding="1" width="500" border="0">
            <tr>
                <td><asp:label id="lblId" runat="server" CssClass="label">Observer Name</asp:label></td>
                <td>
                    <asp:DropDownList ID="ddlID" runat="server" DataSourceID="ODS_Observers" DataTextField="ObserverName" DataValueField="ObserverInitials" CssClass="inputLong" AutoPostBack="True"></asp:DropDownList>
                    <asp:ObjectDataSource ID="ODS_Observers" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DS_DiscardsTableAdapters.USP_ObserversSelectTableAdapter"></asp:ObjectDataSource>
                  </td>
            </tr>
            <tr>
              <td><asp:Label ID="lblYear" runat="server" CssClass="label">Year:</asp:Label></td>
              <td>
               <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="True" CssClass="inputLong" DataSourceID="objTripCodeYears" DataTextField="TripYears" DataValueField="TripYears"></asp:DropDownList>
                  <asp:ObjectDataSource ID="objTripCodeYears" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataTripCodeYears" TypeName="TripCodeYearsTableAdapters.SelectYearsFromTripCodesByIDTableAdapter">
                     <SelectParameters>
                             <asp:ControlParameter ControlID="ddlID" Name="ObserverID" PropertyName="SelectedValue" Type="String" />
                         </SelectParameters>
                   </asp:ObjectDataSource>               
              </td>
            </tr>
                <tr>
                    <td><asp:label id="lblTripCode" runat="server" CssClass="label">Trip Code:</asp:label></td>
                    <td>
                    <asp:Label ID="lblTripCount" runat="server" CssClass="labelNoCount" Visible="false"></asp:Label>
                      <asp:DropDownList ID="ddlTripCode" runat="server" AutoPostBack="True" CssClass="inputLong" DataSourceID="objTripCodes" DataTextField="TripCode" DataValueField="TripCode"></asp:DropDownList>
                      <asp:ObjectDataSource ID="objTripCodes" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetDisTripCodesByIDAndYear" TypeName="TripCodeYearsTableAdapters.DisGetTripCodesByIDAndYearTableAdapter">
                       <SelectParameters>
                             <asp:ControlParameter ControlID="ddlID" Name="ObserverID" PropertyName="SelectedValue" Type="String" />
                             <asp:ControlParameter ControlID="ddlYear" Name="TripYear" PropertyName="SelectedValue" Type="Int32" />
                         </SelectParameters>
                     </asp:ObjectDataSource>
                   </td>
                </tr>
             </table>

Whenever the ddlTripCode SelectedValue is changed, the grid needs rebound. The problem is that when ddlTripCode SelectedValue changes, the NeedDataSource appears to be retaining the PREVIOUS SelectedValue, not the new one.

Here is my NeedDataSource code:

Protected Sub RDHauls_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RDHauls.NeedDataSource
            ' Get the Trip Code for binding the grid
            TripCode = RTrim(CStr(ddlTripCode.SelectedValue))
            ' Get all the haul(s) details for the trip code selected
            Dim ds As New DSHaulsTableAdapters.DisGetHaulDetailsByTripcodeTableAdapter
            ' Bind the grid to the haul(s) details
            RDHauls.DataSource = ds.GetHaulDetailsByTripcode(TripCode)
        End Sub

Any advice please? I have to keep re-selecting a ddlTripCode SelectedValue to get the grid to bind to the correct data.

Thank you, Ida
Kostadin
Telerik team
 answered on 20 Dec 2013
1 answer
124 views
Can i change the pagesize of the loadpersister being loaded? It seems to be that I am having a tunnel vision atm and can't think of any work around

    Dim LoadPersister As New GridSettingsPersister(RadGrid1)
LoadPersister.LoadSettings(*some string or session here*)
RadGrid1.Rebind()

this is the codebehind of loading the loadingpersister any process that I can change the pagesize being rebinded?

Thanks in advance
Daniel
Telerik team
 answered on 20 Dec 2013
1 answer
109 views
guys, I've  got a rad filter w/ several filters in there - for this purpose only one of the field editors is shown.
in the code behind for this filter in the OnItemCommand, i'm able to default it to zero - is there a way to also make this one filter "read only"
when it's chosen? or would I need a special "custom class"?
thanks for any Help on this.
rik

<telerik:RadFilter ID="WorkOrderItemsRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

OnApplyExpressions="WorkOrderItemsRadFilter_Apply" ApplyButtonText="Filter Work Order Items"

OnPreRender="WorkOrderItemsRadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating" OnItemCommand="WorkOrderItemsRadFilter_ItemCommand">

<FieldEditors>

<telerik:RadFilterNumericFieldEditor FieldName="MATERIALGRADEID" DisplayName="Empty Grade" DataType="System.Int32" />
</FieldEditors>
</telerik:RadFilter>
CODE BEHIND IN THE ON ITEM COMMAND - TAKEN OUT OF CONTEXT:

else if (myCmdArg == "MATERIALGRADEID")

{

e.Canceled = true;

RadFilterStartsWithFilterExpression item = new RadFilterStartsWithFilterExpression(e.CommandArgument.ToString());

//replace the current item with the new item that has the default filter set to StartsWith

int i = e.ExpressionItem.ItemIndex;

e.ExpressionItem.OwnerGroup.Expression.Expressions.RemoveAt(i);

e.ExpressionItem.OwnerGroup.Expression.Expressions.Insert(i, item);

item.Value = "0";//DEFAULT THIS TO ZERO

WorkOrderItemsRadFilter.RecreateControl();

 

 

 

Viktor Tachev
Telerik team
 answered on 20 Dec 2013
1 answer
135 views
Hi 

I have a grid rgrdServiceJob which has a number of columns, one of which uses a RadToolTipManager to show a user control CallDetails.ascx. I can pass in the service job number from the grid using the Public Property on the control - no problem there - and populate the tooltip with some data - groovy.

Now I need to click a button on the control which will then hide the control and expand the calling grid row  - this is where I'm stuck and could do with a little advice .

Steve
Eyup
Telerik team
 answered on 20 Dec 2013
1 answer
242 views
Hi
i have a buttoncolumn with buttontype as image . I want to create a hover effect for the button only. How to get it?
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2013
1 answer
537 views
Hello

I'm building a photo cropper that loads an editor via html5 filereader.  The editor is loaded via a radAsyncUploader set to manual upload.  When the user finishes cropping they click upload, and the radAsyncUploader hits my custom handler.

That all is working fine -  however, I can't for the life of me get the server side FileUploaded event to work.  Here's my control markup:

<div class="buttons">
    <div>
        <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" OnClientFileDropped="RadAsyncUpload1_FileDropped" OnClientFileSelected="RadAsyncUpload1_FileSelected"
            OnClientFilesSelected="" HideFileInput="True" Width="221px" HttpHandlerUrl="~/CustomHandlers/CropImage.ashx" ManualUpload="True"
            OnClientFileUploaded="RadAsyncUpload1_FileUploaded" OnClientFileUploading="RadAsyncUpload1_FileUploading" EnableInlineProgress="True"
            DisableChunkUpload="True" CssClass="radButton" DropZones="#generated" OnClientFileUploadRemoved="RadAsyncUpload1_FileUploadRemoved"
            Skin="Default"></telerik:RadAsyncUpload>
    </div>
    <div >
        <input ID="UploadButton" class="upload-file" type="button" value="Upload"  onclick="startUpload()"/></div>
    <div style="clear: both">
    </div>
Server side I have this:
protected void Page_Load(object sender, EventArgs e)
{
    RadAsyncUpload1.PostbackTriggers = new string[] { "UploadButton" };
}
 
protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
    //nothing yet!
}
I have tried subscribing to FileUploaded in Page_Load, as well as triggering a postpack in the client-side RadAsyncUpload1_FileUploaded
handler.  Nothing so far has worked.  Appreciate any help on this!

update:  I modified a sample project you guys provided showing implementation.  The event fired when using a custom handler as soon as the upload button was clicked.  However, the handler fires as soon as the file is selected.  I therefore changed manual upload to true and added an upload button click event handler to start the upload.  In this setup, the handler runs when the upload button is clicked (this is what I need to happen), but the fileUploaded event never fires.

here's the page code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<%@ Register Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
 
 
 
</head>
<body>
    <form runat="server">
 
        <script type="text/javascript">
            
            
         
        </script>
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
 
        <telerik:RadAsyncUpload ID="radAsyncUpload" runat="server" EnableInlineProgress="true" OnFileUploaded="RadAsyncUpload1_FileUploaded"
             MaxFileInputsCount="1" OnClientFileUploaded="onClientFileUploaded" OnClientFileUploadRemoved="onClientFileUploadRemoved"
             PostbackTriggers="radUpload" HttpHandlerUrl="~/CustomHandler.ashx" DisableChunkUpload="True" ManualUpload="True" OnClientFilesSelected="onClientFileSelected" />
 
        <telerik:RadButton ID="radUpload" runat="server" Text="Upload" Enabled="false" CausesValidation="false" OnClientClicked="radUpload_Clicked" />
 
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function onClientFileUploaded(sender, args) {
                    var radUpload = $find("<%=radUpload.ClientID %>");
 
              radUpload.set_enabled(true);
          }
                function onClientFileUploadRemoved(sender, args) {
                    var radUpload = $find("<%=radUpload.ClientID %>");
 
              radUpload.set_enabled(false);
          }
                function onClientFileSelected(sender, args) {
                    var radUpload = $find("<%=radUpload.ClientID %>");
 
              radUpload.set_enabled(true);
          }
            function radUpload_Clicked(sender,args)
            {
                var upload = $find('<%=radAsyncUpload.ClientID%>');
                upload.startUpload();
            }
          </script>
        </telerik:RadScriptBlock>
 
 
 
 
 
 
    </form>
</body>
</html>




Thanks,
Michael
Kate
Telerik team
 answered on 20 Dec 2013
5 answers
252 views
Hi there,

I have a huge set of data which i need to bind to on demand (on keystroke). Im currently using the AutoCompleteBox in SharePoint which won't allow me to call a webservice in the style that you suggest due to the security within SharePoint:

<WebServiceSettings Path="/_layouts/SP.SyncMatrix/GetSiteData.aspx" Method="GetSites" />

Since you don't allow a client side method of databinding, i was wanting to know if this is the only way of doing on-demand code behind (server side) bind. I did see that there is a ontextchanged method, is there an opportunity to rebind the datasource there?

If not, is there anyway to modify the POST request that your control sends before it is sent? there is the client side onrequesting method but that doesnt seem to allow me to modify the post data at all.

Nencho
Telerik team
 answered on 20 Dec 2013
14 answers
222 views

In IE 10 with RTL, the control (textbox and the select button) disappears once it’s being clicked.

You can notice the problem in telerik’s demos:

http://demos.telerik.com/aspnet-ajax/asyncupload/examples/rtl/defaultcs.aspx


Is there any workaround to make it work?

Thanks
Boyan Dimitrov
Telerik team
 answered on 20 Dec 2013
2 answers
164 views
All,

Can you please inform me how I can populate the appointment description field thru Javascript.

I have everything working for all other fields except description.  When i double click on the appointment , the advance form does display the description field but it is empty.
I am writing the appointments to am XML file, I see entries for <description></description> , once again blank.

Any advise would be helpful.
function rowDropping(sender, args) {
       // Fired when the user drops a grid row
       var htmlElement = args.get_htmlElement();
       var scheduler = $find('<%= RadScheduler1.ClientID %>');
       var tree = $find('<%= RadTreeView1.ClientID %>');
       var login = $find('<%= LoginName1.ClientID %>');
       var node = tree.get_selectedNode();
       var treenode = tree.get_selectedNode();
       //alert(treenode.get_attributes().getAttribute("Park"));
       var park = treenode.get_attributes().getAttribute("Park");
       if (isPartOfSchedulerAppointmentArea(htmlElement)) {
           // The row was dropped over the scheduler appointment area
           // Find the exact time slot and save its unique index in the hidden field
           var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
           //args.get_htmlElement("TargetSlotHiddenField").value = timeSlot.get_index();
           // The HTML needs to be set in order for the postback to execute normally
           //args.set_htmlElement("TargetSlotHiddenField");
           var newAppointment = new Telerik.Web.UI.SchedulerAppointment(); 
           var startTime = timeSlot.get_startTime();
           var endTime = new Date(startTime);
           endTime.setMinutes(endTime.getMinutes() + 30);
           var subject = node.get_text();                    
           newAppointment.set_start(startTime); // This populates
           newAppointment.set_end(endTime); // This populates
           newAppointment.set_subject(subject); // This  populates
           newAppointment.set_description("hello"); // Does not  populate
           newAppointment.set_borderColor("Green"); // Does not change
           newAppointment.set_backColor("DarkGreen");  // Does not  change
           scheduler.insertAppointment(newAppointment);
 
       }
Hristo Valyavicharski
Telerik team
 answered on 20 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?