Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
126 views
I am trying to figure out how to best export a subset of data from a R.A.D. Grid. Specifically, I want to export only the selected items of the grid. It is a paged grid, non-hierarchical. If anyone knows a good way to do this, please let me know.
Daniel
Telerik team
 answered on 27 Jan 2011
1 answer
143 views
I am trying to implement the following sample: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultvb.aspx

I would like this to work with just two DateTimePickers as the only two editable fields.

The problem I believe is the javascript 'GridCreated' function which uses the .onchange trigger of the textboxes. Since the DateTimePickers are a little complex they appear to have 3 inputs per picker.  The 'TrackChanges' doesnt seem to be firing at all.

Here is my code:

<form id="form1" runat="server">
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
       <Scripts>
           <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
           <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
           <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
       </Scripts>
   </telerik:RadScriptManager>
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
           <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="timesheetView">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="timesheetView" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
   </telerik:RadAjaxManager>
      
   <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="WebBlue">
   </telerik:RadSkinManager>
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"  
               Transparency="25" Width="75px">   
               <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'  
                   style="border: 0px;" />  
   </telerik:RadAjaxLoadingPanel>  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
      <script type="text/javascript">
          var hasChanges, inputs, dropdowns, editedRow;
          function RowClick(sender, eventArgs) {
              if (editedRow != null && hasChanges) {
                  if (confirm("Update changes?")) {
                      hasChanges = false;
                      $find("<%= timesheetView.MasterTableView.ClientID %>").updateItem(editedRow);
                  }
                  else {
                      hasChanges = false;
                  }
              }
          }
          function RowDblClick(sender, eventArgs) {
              if (editedRow && hasChanges) {
                  if (confirm("Update changes?")) {
                      hasChanges = false;
                      $find("<%= timesheetView.MasterTableView.ClientID %>").updateItem(editedRow);
                  }
                  else {
                      hasChanges = false;
                  }
              }
              editedRow = eventArgs.get_itemIndexHierarchical();
              $find("<%= timesheetView.MasterTableView.ClientID %>").editItem(editedRow);
          }
           function GridCreated(sender, eventArgs)
           {           
               var gridElement = sender.get_element();
               var elementsToUse = [];
               inputs = gridElement.getElementsByTagName("input");
               for (var i = 0; i < inputs.length;i++)
               {
                   var lowerType = inputs[i].type.toLowerCase();
                   if(lowerType == "hidden" || lowerType == "button")
                   {
                       continue;
                   }
                   var id = inputs[i].id; 
                          // This filters only the date time pickers
                   if ((id.indexOf("dateInput_text") != -1) == true) {
                       Array.add(elementsToUse, inputs[i]);
                       inputs[i].onchange = TrackChanges;
                       hasChanges = true;
                   }
               }
                 
               dropdowns = gridElement.getElementsByTagName("select");
               for (var i = 0; i < dropdowns.length;i++)
               {
                   dropdowns[i].onchange = TrackChanges;
               }
               setTimeout(function(){if(elementsToUse[0])elementsToUse[0].focus();},100);
           }
          function TrackChanges(e) {
              hasChanges = true;
          }
  </script>
  </telerik:RadCodeBlock>
   <div>
           <telerik:RadGrid Width="500px" ID="timesheetView" ShowStatusBar="True" AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True"
           runat="server" AutoGenerateColumns="false" EnableAJAX="True" EnableAJAXLoadingTemplate="True"     
               LoadingTemplateTransparency="25" AllowAutomaticUpdates="true" >      
            <MasterTableView AllowAutomaticUpdates="true" EditMode="InPlace">
              <Columns>
              <telerik:GridBoundColumn UniqueName="EventDate" DataField="EventDate" HeaderText="Date" ReadOnly="True" HeaderStyle-Width="25%" />
                <telerik:GridBoundColumn UniqueName="Location" DataField="Location" HeaderText="Location" ReadOnly="True" HeaderStyle-Width="25%" />
                <telerik:GridDateTimeColumn PickerType="TimePicker" UniqueName="InTime" DataType="System.DateTime" DataFormatString="{0:t}" DataField="InTime" HeaderText="In" ReadOnly="False" HeaderStyle-Width="25%" />
                <telerik:GridDateTimeColumn PickerType="TimePicker" UniqueName="OutTime" DataType="System.DateTime" DataFormatString="{0:t}" DataField="OutTime" HeaderText="Out" ReadOnly="False" HeaderStyle-Width="25%" />
      
              </Columns>
            </MasterTableView>
           <ClientSettings>
              <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"
                  OnGridCreated="GridCreated" />
          </ClientSettings>
   </telerik:RadGrid>
   </div>
   </form>

Code Behind: ( uses two classes that Im using as an ObjectDataSource)

Private Sub timesheetView_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles timesheetView.NeedDataSource
    Dim Timesheet As New Timesheet
    Timesheet.AddEntry("OFFICE ADMIN", DateTime.Now.AddHours(-1), DateTime.Now.AddHours(2))
    Timesheet.AddEntry("OFFICE XC", DateTime.Now.AddHours(-6), DateTime.Now.AddHours(3))
    Timesheet.AddEntry("OFFICE 9", DateTime.Now.AddHours(-4), DateTime.Now.AddHours(9))
    Timesheet.AddEntry("OFFICE 8", DateTime.Now.AddHours(-2), DateTime.Now.AddHours(7))
    timesheetView.DataSource = Timesheet.List
End Sub


How do I get GridDateTimeColumn to work in InPlace edit mode? I would possibly like to refresh the entire grid when the DateTimePicker has been changed.

Thankyou.

Serban.

Marin
Telerik team
 answered on 27 Jan 2011
1 answer
228 views
Hi,

I have a grid placed inside Div. I am displaying about 15 columns so when it goes long, Div displays Scrollbar to move right.
The problem is that somehow Grid displays a Vertical line exactly where Div's right border ends. I mean when we move scrollbar to right, it displays one Vertical line in between of column, as soon as we move scrollbar.

If I change my Div width to 1500 or more then grid fits inside Div so does not display this Vertical line but when div displays scrollbar and have to scroll to right, it displays a vertical line exactly from where scroll starts on right side.
But I cannot increase my Div width because of my screen size.
Please let me know what settings do I need to add for this?
Here is my code.
.Scrollgrid
        position: static; 
        OVERFLOW: scroll; border:2px; border-style:solid;
}        
.panelStyle
{
            width:100%;
}
  
                            <asp:Panel runat="server" ID="pnlOverview" CssClass="panelStyle">
                                <table width="100%">
                                    <tr align="center">
                                        <td>
  
  
                                            <div class="Scrollgrid" style="width: 1100px; height: 600px;">
                                                <telerik:RadGrid ID="RadGridAllRequests" runat="server" AllowPaging="true" AllowSorting="true"
                                                    AllowFilteringByColumn="true" AutoGenerateColumns="False" GridLines="Both" OnNeedDataSource="RadGridAllRequests_needdatasource"
                                                    OnItemDataBound="RadGridAllRequests_ItemDataBound" 
                                                    OnItemCreated="RadGridAllRequests_ItemCreated"
                                                    OnItemCommand="RadGridAllRequests_ItemCommand"
                                                    AllowMultiRowSelection="true" SelectedItemStyle-CssClass="SelectedItem" 
                                                       
                                                    Width="100%"
                                                    Skin="WebBlue">
                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="true" />
                                                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                                        <Selecting AllowRowSelect="true" />
                                                    </ClientSettings>
                                                      
                                                    <MasterTableView ShowHeadersWhenNoRecords="true" 
                                                    AllowFilteringByColumn="true" DataKeyNames="RequestInfoID">
                                                        <Columns>
  
<!-- I am displaying about 15 columns here -->
  
                                                        </Columns>
                                                        <EditFormSettings>
                                                            <PopUpSettings ScrollBars="None" />
                                                        </EditFormSettings>
                                                        <ExpandCollapseColumn Resizable="False" Visible="False">
                                                            <HeaderStyle />
                                                        </ExpandCollapseColumn>
                                                        <RowIndicatorColumn Visible="False">
                                                            <HeaderStyle />
                                                        </RowIndicatorColumn>
                                                    </MasterTableView>
                                                </telerik:RadGrid>
                                            </div>
  
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>

Thanks in advance,
Nirav
Top achievements
Rank 1
 answered on 27 Jan 2011
2 answers
138 views
Hi,
I am following http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx this example.
On one of the panels, I have a grid. What I would like to do is, do not display grid if there is no data. Display a single line message.
How can I do that ???

Please help,

Thanks
Smiely
Top achievements
Rank 1
 answered on 27 Jan 2011
2 answers
93 views
Hi,
I am using Telerik RadGrid and displaying about 15 columns.
Now I want to set width for a particular column, not for all columns.
I tried giving HeaderStyle width but somehow its not changing width.
If I use TableLayout="Fiexed", I will have to set all the columns width and also it cut out rest of the words.
And actually depending upon my columns, I prefer not to set width for columns but I just want to set width for one single column.

Here is my code and I want to set width for "rejectrequest" column only.
Want to have every other column as auto width which is working fine.
NOTE: In my sample code, I have not added all of my columns. Added few columns only but actually I have more columns than this.

<div class="Scrollgrid" style="width: 1100px; height: 600px;">
                                                <telerik:RadGrid ID="RadGridAllRequests" runat="server" AllowPaging="true" AllowSorting="true"
                                                    AllowFilteringByColumn="true" AutoGenerateColumns="False" GridLines="Both" OnNeedDataSource="RadGridAllRequests_needdatasource"
                                                    OnItemDataBound="RadGridAllRequests_ItemDataBound" 
                                                    OnItemCreated="RadGridAllRequests_ItemCreated"
                                                    OnItemCommand="RadGridAllRequests_ItemCommand"
                                                    AllowMultiRowSelection="true" SelectedItemStyle-CssClass="SelectedItem" 
                                                       
                                                    Width="100%"
                                                    Skin="WebBlue">
                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="true" />
                                                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                                        <Selecting AllowRowSelect="true" />
                                                    </ClientSettings>
                                                      
                                                    <MasterTableView ShowHeadersWhenNoRecords="true" 
                                                    AllowFilteringByColumn="true" DataKeyNames="RequestInfoID">
                                                        <Columns>
                                                            <telerik:GridNumericColumn DataField="RequestInfoID" HeaderText="Request No." SortExpression="RequestInfoID"
                                                                DataType="System.Int64" FilterControlWidth="40px" 
                                                                HeaderStyle-Width="100px"                                                                
                                                                >
                                                            </telerik:GridNumericColumn>
                                                            <telerik:GridDateTimeColumn 
                                                            HeaderStyle-Width="130px"     
                                                            DataField="CreationDate" HeaderText="Created On" FilterControlWidth="100px"
                                                                CurrentFilterFunction="Contains" PickerType="DatePicker" DataFormatString="{0:MM/dd/yyyy}"
                                                                SortExpression="CreationDate">
                                                            </telerik:GridDateTimeColumn>
                                                            <telerik:GridNumericColumn DataField="TotalAmount" HeaderText="Total Amount" SortExpression="TotalAmount"
                                                                HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" DataType="System.Decimal"
                                                                FilterControlWidth="70px" DataFormatString="{0:#,##0.00}">
                                                                <FooterStyle Font-Bold="true" />
                                                            </telerik:GridNumericColumn>
                                                            <telerik:GridBoundColumn DataField="RequestedFrom_Email" HeaderText="Requested From"
                                                                SortExpression="RequestedFrom_Email">
                                                            </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Describe Reason and Reject" UniqueName="rejectrequest"
                                                               
                                                                AllowFiltering="false"  
                                                                HeaderStyle-Width="240px" >
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblNextApprovalRequiredFor" runat="server" Visible="false" Text='<%#Eval ( "NextApprovalRequiredFor").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblUnder5000ApprovedORRejected" runat="server" Visible="false" Text='<%#Eval ( "Under5000ApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblOver5000ApprovedORRejected" runat="server" Visible="false" Text='<%#Eval ( "Over5000ApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblFinanceApprovedORRejected" runat="server" Visible="false" Text='<%#Eval ( "FinanceApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblOver25000CFOApprovedORRejected" runat="server" Visible="false"
                                                                        Text='<%#Eval ( "Over25000CFOApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblOver25000COOApprovedORRejected" runat="server" Visible="false"
                                                                        Text='<%#Eval ( "Over25000COOApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblOver25000CEOApprovedORRejected" runat="server" Visible="false"
                                                                        Text='<%#Eval ( "Over25000CEOApprovedORRejected").ToString()%>'></asp:Label>
                                                                    <asp:Label ID="lblRejectedMessage" runat="server" Text="Rejected"></asp:Label>
                                                                    <asp:TextBox Width="150px" runat="server" MaxLength="150" ValidationGroup="vgRejection"
                                                                        ID="txtRejectionReason" ToolTip="Enter Rejection Reason"></asp:TextBox>
                                                                    <%--                                                            <asp:RequiredFieldValidator 
                                                                ID="rvRejectionReason" 
                                                                Display="Dynamic"
                                                                ValidationGroup="vgRejection"
                                                                runat="server" 
                                                                SetFocusOnError="true"
                                                                ControlToValidate="txtRejectionReason" 
                                                                ErrorMessage="Enter Rejection Reason" 
                                                                ToolTip="Enter Rejection Reason">
                                                            </asp:RequiredFieldValidator>                        
--%>
                                                                    <asp:Button  CssClass="ButtonCSS" 
                                                                    runat="server" ID="btnRejectRequest" Text="Reject" 
                                                                    ToolTip="Click here to Reject Request"
                                                                    CausesValidation="true" ValidationGroup="vgRejection" OnClick="btnRejectRequest_Click"
                                                                    OnClientClick="javascript:var agree= confirm('Are you sure you want to reject this Request? '); if(agree){ Page_BlockSubmit = false;buttonClicked_WithObj(this); return true; };else {return false;};"
                                                                    CommandArgument='<%# 
                                                                Eval ( "RequestInfoID").ToString() 
                                                                + ";" +
                                                                Eval ( "NextApprovalRequiredFor").ToString() 
                                                                + ";" +
                                                                Eval ( "TotalAmount").ToString() 
                                                                  
                                                                %>' />
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn DataField="Request_Current_Status_DisplayText" HeaderText="Current Status"
                                                                SortExpression="Request_Current_Status_DisplayText" UniqueName="Request_Current_Status_DisplayText">
                                                            </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Request No." SortExpression="RequestInfoID"
                                                                AllowFiltering="false" Visible="false" UniqueName="requestinfoid">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="lblRequestInfoID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "RequestInfoID")%>'></asp:Label></ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                        </Columns>
                                                        <EditFormSettings>
                                                            <PopUpSettings ScrollBars="None" />
                                                        </EditFormSettings>
                                                        <ExpandCollapseColumn Resizable="False" Visible="False">
                                                            <HeaderStyle />
                                                        </ExpandCollapseColumn>
                                                        <RowIndicatorColumn Visible="False">
                                                            <HeaderStyle />
                                                        </RowIndicatorColumn>
                                                    </MasterTableView>
                                                </telerik:RadGrid>
                                            </div>

Thanks in advance ,


Nirav
Top achievements
Rank 1
 answered on 27 Jan 2011
4 answers
231 views
The problem that I am having is with the cascading drop down combo box.

When you preset the first, and second drop down with default values or preset values like you would have if a user has to re-edit a form.  The second drop drop down will not return the selected value if the user changes the first drop down then selects the second  drop down.  The value returned is always the value of the first item in the drop-down list.

Example:  preset the a country drop down to United States. Then the second to Florida.  If the user changes the country to Canada then selects a Canadian region, the value returned will be the first state listed for the United States not the Canadian region selected.  

.ascx code
<tr>
                <td colspan="2" class="t12_BlackBold"><div align="right">
                  Country:  <span class="t12_red">*</span>
                </div></td>
                <td class="style1"><div align="left">
                    <telerik:RadComboBox ID="frm_sCountry_cd" Runat="server" 
                        DataTextField="sCountry" 
                        DataValueField="sCountry_cd" 
                                                 
                        ErrorMessage="Required field." 
                        Skin="Outlook" 
                        Width="180px" 
                        DropDownWidth="240px" 
                        MaxHeight="300px"
                        onclientselectedindexchanged="LoadStates"
                        OnItemsRequested="frm_sCountry_cd_ItemsRequested">
                    </telerik:RadComboBox><asp:CompareValidator ID="sCountry_cd_VD" runat="server"
                        ValueToCompare="-Select a Country-"
                        Operator="NotEqual"
                        ControlToValidate="frm_sCountry_cd"
                        CssClass="KT_field_error" Font-Bold="True" Display="Dynamic"
                        ErrorMessage="<br />You must select a country."/>
                    </div></td>
              </tr>
              <tr>
                <td colspan="2" class="t12_BlackBold"><div align="right">
                  State/Region: <span class="t12_red">*</span>
                </div></td>
                <td class="style1"><div align="left">
                    <telerik:RadComboBox ID="frm_sState" Runat="server" 
                        DataTextField="sStateDesc" DataValueField="sState" 
                        EmptyMessage="-Select State-" 
                        ErrorMessage="Required field." 
                        Skin="Outlook" Width="180px" 
                        MaxHeight="300px"
                        DropDownWidth="200px"
                        OnClientItemsRequested="ItemsLoaded"
                        OnItemsRequested="frm_sState_ItemsRequested" >
                    </telerik:RadComboBox><asp:CompareValidator ID="sState_VD" runat="server"
                        ValueToCompare="-Select State/Region-"
                        Operator="NotEqual"
                        ControlToValidate="frm_sCountry_cd"
                        CssClass="KT_field_error" Font-Bold="True" Display="Dynamic"
                        ErrorMessage="<br />You must select a state/region."/>
                    </div></td>
              </tr>
  
.
.
.
.
<script type="text/javascript">
//global variables for the countries and cities comboboxes
var sStatesCombo;
  
function pageLoad()
{
    // initialize the global variables
    // in this event all client objects 
    // are already created and initialized 
    sStatesCombo = $find("<%= frm_sState.ClientID%>");
  
function LoadStates(combo, eventArqs)
{
    var item = eventArqs.get_item();
    sStatesCombo.set_text("Loading...");
    // if a continent is selected
    if (item.get_index() > 0)
    {        
     // this will fire the ItemsRequested event of the 
     // countries combobox passing the sCountry_id as a parameter 
          
        if (sStatesCombo.get_visible == false ) 
        {
            sStatesCombo.set_visible(true);
        }
        sStatesCombo.clearItems();
        sStatesCombo.requestItems(item.get_value(), false);
          
        sStatesCombo.commitChanges();
           
        items = sStatesCombo.get_items();
        if (items.get_count() == 0)
        {
            sStatesCombo.set_text("-Select State/Region-");
        }
        else 
        {
            sStatesCombo.clearItems();
        }
    }
    else
    {
     // the -Select a continent- item was chosen
        sStatesCombo.set_text("-Select Country first-");
        sStatesCombo.clearItems();
    }
}
  
function ItemsLoaded(combo, eventArqs) {
    if (combo.get_items().get_count() > 0) {
        // pre-select the first item
        combo.set_text(combo.get_items().getItem(0).get_text());
        combo.get_items().getItem(0).highlight();
    }
    combo.showDropDown();
}
 </script>


.ascx.vb code
'Code used in updating the values
...
 'Setup Country and state drop downs 
                LoadCountries()
            frm_sCountry_cd.SelectedValue = sCountry_cd
            LoadStates(sCountry_cd)
            If sState <> "" Then frm_sState.SelectedValue = sState
...
  
Protected Sub LoadCountries()
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("AAU_StoreCS").ConnectionString)
        Dim adapter As New SqlDataAdapter("SELECT Value AS sCountry_cd, Text AS sCountry, EntryID AS ParentID, 0 as sOrder FROM Mstr_Lists WHERE (ListName = 'Country') AND (Value = 'US') UNION SELECT Value AS sCountry_cd, Text AS sCountry, EntryID AS ParentID, 1 as sOrder FROM Mstr_Lists AS Mstr_Lists_1 WHERE (ListName = 'Country') Order by sOrder, sCountry", connection)
        Dim dt As New DataTable()
        adapter.Fill(dt)
  
        frm_sCountry_cd.DataTextField = "sCountry"
        frm_sCountry_cd.DataValueField = "sCountry_cd"
        frm_sCountry_cd.DataSource = dt
        frm_sCountry_cd.DataBind()
        'insert the first item
        frm_sCountry_cd.Items.Insert(0, New RadComboBoxItem("-Select a Country-"))
  
    End Sub
  
 Protected Sub LoadStates(ByVal sCountry_cd As String)
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("AAU_StoreCS").ConnectionString)
  
        'Select states/regions based on the sCountry_cd
        Dim adapter As New SqlDataAdapter("SELECT Value AS sState, Text AS sStateDesc, ParentID FROM Mstr_Lists WHERE (ListName = 'Region') AND (ParentID = (SELECT EntryID FROM Mstr_Lists AS Mstr_Lists_1 WHERE (ListName = 'Country') AND (Value = @Country_cd))) ORDER BY sStateDesc", connection)
  
        adapter.SelectCommand.Parameters.AddWithValue("@Country_cd", sCountry_cd)
  
        Dim dt As New DataTable()
        adapter.Fill(dt)
        frm_sState.DataTextField = "sStateDesc"
        frm_sState.DataValueField = "sState"
        frm_sState.DataSource = dt
        frm_sState.DataBind()
        If Not frm_sState.IsEmpty Then
            frm_sState.Visible = True
            'sStateTxt.Visible = False
            'insert the first item
            If sCountry_cd = "US" Then
                frm_sState.Items.Insert(0, New RadComboBoxItem("-Select State-"))
            Else
                frm_sState.Items.Insert(0, New RadComboBoxItem("-Select State/Region-"))
            End If
        Else
            'frm_sState.Visible = False
            'sStateTxt.Visible = True
        End If
    End Sub
  
  
'Code used to read values during post back.
...
Dim sState As String = Left(Replace(frm_sState.SelectedValue.ToString(), "'", "''"), 20)
Dim sCountry_cd As String = Left(Replace(frm_sCountry_cd.SelectedValue.ToString, "'", ""), 2)
...
Kalina
Telerik team
 answered on 27 Jan 2011
3 answers
96 views
Hi all,
          I am attaching the  image file. please refer it, I want to implement the exact functionality. 
I want to use this functionality for designing forms.

Its very challenging task for me.  Please give some Idea or logic.
I want to use telerik controls.

please help me.
thanks!
Pavlina
Telerik team
 answered on 27 Jan 2011
2 answers
95 views
I have a radgrid which is populated via my vb code below:

Dim Get_Service_Reports As String = "Select * from Service_Reports "  
Get_Service_Reports_Adapter = New SqlDataAdapter(Get_Service_Reports, DBConn)   
Service_Reports_Table =
New DataTable  
Get_Service_Reports_Adapter.Fill(Service_Reports_Table)  
If Not IsPostBack Then
RadGrid1.DataSource = Service_Reports_Table End If

  
RadGrid1.DataBind()


That code executes in the page load.
I then add the following code to give colors to rows depending on certain values

For

 

i As Integer = 0 To RadGrid1.Items.Count - 1
If Service_Reports_Table(i)("Status") = "Newly Submitted" Then
RadGrid1.Items.Item(i).BackColor = Drawing.Color.Wheat
ElseIf Service_Reports_Table(i)("Status") = "Entered" Then
RadGrid1.Items.Item(i).BackColor = Drawing.Color.Thistle
End If
Next

That code right above appears in both the page load and the needdatasource events.
When a user applies a filter or clicks on the edit, update, cancel commands, the colors disappear until a postback occurs.
Can something be done so that the "Code for the colors" execute when those commands are fired?

 

Arnaud
Top achievements
Rank 1
 answered on 27 Jan 2011
0 answers
88 views
Hi Expert,

I am using the Custom RadTabStrip  in DNN Custom Modules. I am unable to view the UI that I am looking for . Some styles problem occurring in that. But the same code is working fine in the Ordinary .ascx files in the same DNN Project.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="View.ascx.cs" Inherits="DotNetNuke.Modules.CourseSearch.View" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
 <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  <style type="text/css">
        .HovCSS
        {
            background: url('DesktopModules/CourseSearch/images/tab1.gif') no-repeat;
            width: 139px;
            height: 24px;
        }
        .OutCSS
        {
            background: url('DesktopModules/CourseSearch/images/tab2.gif') no-repeat;
            width: 139px;
            height: 24px;
        }
        .SelCss
        {
            background: url('DesktopModules/CourseSearch/images/tab1.gif') no-repeat;
            width: 139px;
            height: 24px;
        }
    </style>
 <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="rmp"
            EnableEmbeddedSkins="false">
            <Tabs>
                <telerik:RadTab Value="Tab1" Text="MyTab1" Selected="true" HoveredCssClass="HovCSS" OuterCssClass="OutCSS"
                    SelectedCssClass="SelCSS">
                </telerik:RadTab>
                <telerik:RadTab Value="Tab2" Text="MyTab2" HoveredCssClass="HovCSS" OuterCssClass="OutCSS" SelectedCssClass="SelCSS">
                </telerik:RadTab>
                <telerik:RadTab Value="Tab3" Text="MyTab3" HoveredCssClass="HovCSS" OuterCssClass="OutCSS" SelectedCssClass="SelCSS">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rmp" SelectedIndex="0" runat="server" Width="100%">
            <telerik:RadPageView ID="FirstPage" runat="server">
                First Page
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadPageView1" runat="server">
                Second Page
            </telerik:RadPageView>
            <telerik:RadPageView ID="RadPageView2" runat="server">
                Third Page
            </telerik:RadPageView>
        </telerik:RadMultiPage>

Please guide me!!!!!!!! to resolve this issue. Its urgent.....

Thanks in Advance!
RaviChandran
Ravi
Top achievements
Rank 1
 asked on 27 Jan 2011
6 answers
58 views

I ran my page through the validator at http://validator.w3.org/, and it told me: Line 467, Column 144: there is no attribute "disabled"

The link it's referring to is inside my grid:

 

<div id="ctl00_cphMain_grdSchedule_ctl00_ctl06_Detail10_ctl06_Detail10_ctl04_ttpScheduleItem" disabled="disabled" style="display:none;position:absolute;">

???

 

 

WombatEd
Top achievements
Rank 1
 answered on 27 Jan 2011
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?