Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
222 views
Hello,

How can I make the Date Picker to show first days of week only
Or at least allow only selection of the first day of week.

Like for January 2011 month allow only 3,10,17,24 & 31 dates to be selected


Thanks,
Sanjay
Shinu
Top achievements
Rank 2
 answered on 12 Jan 2011
0 answers
113 views

i have used date time field with datepicker now i gets problem in find control .in below code..check code properly and reply as soon as possible.
 <telerik:GridDateTimeColumn  FilterControlWidth="120px" DataField="order_date" HeaderText="ORDER DATE" 
                        UniqueName="order_date" PickerType="DatePicker" DataFormatString="{0:D}" SortExpression="order_date" AllowFiltering ="true">
                        <HeaderStyle Width="160px" />



 if (filterPair.First.ToString() == "EqualTo")
            {
                                   string colName = filterPair.Second.ToString();
             //Here i gets problem--->       TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;
                    string values = tbPattern.Text;
                    string newFilter = "(([" + filterPair.Second + "] =" + values + "))";
                    DataTable dt = new DataTable();
                    dt = Session["dt"] as DataTable;
                    DataTable dtNew = new DataTable();
                    dtNew.Columns.Add("order_id");
                    dtNew.Columns.Add("order_date");
                    dtNew.Columns.Add("items_selected");
                    dtNew.Columns.Add("total_amount");
                    dtNew.Columns.Add("order_description");
                    dtNew.Columns.Add("username");
                    dtNew.Columns.Add("status");
                    DataRow row;
                    e.Canceled = true;
umar
Top achievements
Rank 1
 asked on 12 Jan 2011
1 answer
92 views
I have used the following code:-

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
       <telerik:RadPageView ID="RadPageView1" runat="server">
            <telerik:RadGrid ID="rgrd1" runat="server" AutoGenerateColumns="false" 
                      AllowPaging="true" AllowSorting="true"  PageSize="5"  OnSelectedIndexChanged="rgrdAandE_RowSelect"
                       OnPageIndexChanged="rgrd1_PageChange" OnSortCommand="rgrd1_Sort">
                            <MasterTableView>
                                <Columns>
........
                                </Columns>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Bottom" />
              </telerik:RadGrid>

            <telerik:RadGrid ID="rgrd2" runat="server" AutoGenerateColumns="false" 
                      AllowPaging="true" AllowSorting="true"  PageSize="5"  OnSelectedIndexChanged="rgrdAandE_RowSelect"
                       OnPageIndexChanged="rgrd2_PageChange" OnSortCommand="rgrd2_Sort">
                            <MasterTableView>
                                <Columns>
........
                                </Columns>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Bottom" />
              </telerik:RadGrid>
                        
            <telerik:RadGrid ID="rgrd3" runat="server" AutoGenerateColumns="false" 
                      AllowPaging="true" AllowSorting="true"  PageSize="5"  OnSelectedIndexChanged="rgrdAandE_RowSelect"
                       OnPageIndexChanged="rgrd3_PageChange" OnSortCommand="rgrd3_Sort">
                            <MasterTableView>
                                <Columns>
........
                                </Columns>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Bottom" />
              </telerik:RadGrid>

       </telerik:RadPageView>
  </telerik:RadMultiPage>

Code Behind
--------------
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PopulateLists();
            }
        }


        private void PopulateGPViewists()
        {
               DataSet  data = ..........;
                this.rgrd1.DataSource = ............;
                this.rgrd1.DataBind();
                this.rgrd2.DataSource = ............;
                this.rgrd2.DataBind();
                this.rgrd3.DataSource = ............;
                this.rgrd3.DataBind();
            }
        }




When I change the pagesize to say 3 in the text box and click change the gird that I change the pagesize for just disappears. If I refresh the screen it goes back to the original pagesize of 5


Any clues as to why ?

Thanks
Princy
Top achievements
Rank 2
 answered on 12 Jan 2011
1 answer
151 views
 For Each itemcollection As GridDataItem In gvUserJobMapping.Items


            If itemcollection.OwnerTableView.Name = "gvUserJobMapping" Then

            End If


Next


I want to iterate my gridviewrows and how can i access my first column value field in my grid. Because I want to iterate all the rows and keep those values in the arraylist.
Princy
Top achievements
Rank 2
 answered on 12 Jan 2011
0 answers
115 views
I am having Country,Population,website textboxes and States dropdowns in a webform.
I am saving those details into database.
And I am populating Country as parent node and States as child nodes of radtreeview.
On Nodeclick event of the Country I have to populate the population , Country , Website and the relevant States.

I tried using DataValueFied and DataTextField.
I am getting value in e.Node.Text and I am not getting anything in e. Node.Value.

Can you please provide me some sample example for this scenario?

Thanks
Sreedhar Ambati
sreedhar ambati
Top achievements
Rank 1
 asked on 12 Jan 2011
5 answers
343 views
I have switched from a singe page display to a radtabstrip with dynamically created tabs linked to radpageviews.  Outside of all of this is a radtoolbar with controls that I need to control the currently opened radpageview.

Previously I had something like this in javascript:
function DefaultRadToolBarClick(sender, args)
            {
                var button = args.get_item().get_value();
                document.getElementById("txtAction").value = button;
                switch (button)
                {
                    case "tbrRunQuery" :
                        if ( window.frames(0).document.getElementById("loadingDiv")!= null)
                        {
                            window.frames[0].showLoading(true);
                        }
                        window.frames(0).document.getElementById("txtAction").innerText = button;
                        window.frames(0).document.forms(0).submit() ;
                        window.frames(0).document.getElementById("txtAction").innerText = "" ;
                        break ;
...

What would I replace the window.frames(0).document with to get the currently open radpageview?

Here is the HTML of the pane containing the tabs and pageviews:
<telerik:RadPane ID="DefaultRadPaneCont" runat="server">
<div class="content">
<telerik:RadTabStrip ID="DefaultRadTabStrip" align="left" Width="100%" runat="server" Skin="Office2007" MultiPageID="DefaultRadMultiPage">
<TabTemplate
<div class="textWrapper">
<%#DataBinder.Eval(Container, "Text")%> 
<img style="margin-left: 5px; margin-top: 5px" src="Images/delete.gif" alt="delete" onclick="deleteTab('<%# DataBinder.Eval(Container, "Text") %>')" /> 
</div>
</TabTemplate
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="DefaultRadMultiPage" runat="server">
</telerik:RadMultiPage>
 </div>
</telerik:RadPane>


Kent
Top achievements
Rank 1
 answered on 12 Jan 2011
2 answers
93 views
my edit form type uses Template.
when i click on Add New Item the template opens in insert mode,

in each item i have a linkbutton templatecolumn called "Edit" when click on it i run the code below to open the template in edit mode.
GridDataItem gdi = (GridDataItem)LinkButton1.Parent.Parent;
RadGrid1.Items[gdi.ItemIndex].Edit = true;
RadGrid1.Rebind();

If the Edit link is clicked while the template is opened in Insert Mode i get error.

Any idea how to avoid this problem?
thanks in advance
sf
Top achievements
Rank 1
 answered on 12 Jan 2011
0 answers
131 views
I am having an issue with the text in the ToolBarButton. It overflow over the boundaries of the ToolBarButton. Please see the link below to download the code.
http://cid-396be546f23b9132.office.live.com/self.aspx/Public/code.zip
Thanks,
Jason


J
Top achievements
Rank 1
 asked on 12 Jan 2011
1 answer
97 views
Hi,

I am using RadGrid within a usercontrol sitting inside a SharePoint webpart. All my other functionalitites are working fine, but I am having issues when once I scroll through couple of pages in the grid and then try to hit filter button I get an error 'null' is null or not an object. Below is my RadGrid within a user control, any help will be greatly appreciated as I don't want to give a buggy UI to my clients:

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
        <script type="text/javascript">
            function GetSelectedItems() {
                alert($find("<%= grdAllContacts.MasterTableView.ClientID %>").get_selectedItems().length);
            }
        </script>
  
    </telerik:RadCodeBlock>
  
<br />
<!-- content start -->
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdAllContacts" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>      
                    <telerik:AjaxSetting AjaxControlID="grdAllContacts">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="grdAllContacts" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <asp:Button ID="Button2" CssClass="button" Text="Get Selected Items Count" OnClientClick="GetSelectedItems(); return false;" runat="server" />
<br />
            <telerik:RadGrid ID="grdAllContacts" Width="97%" 
             AllowPaging="True" PageSize="20" runat="server" ShowGroupPanel="false"
             OnNeedDataSource="grdAllContacts_NeedDataSource" GridLines="None"  AutoGenerateColumns="false" AllowMultiRowSelection="true">
                
              <PagerStyle Mode="NextPrev" />                
              <GroupHeaderItemStyle BorderColor="Black" Font-Bold="true"></GroupHeaderItemStyle>
  
                 <MasterTableView Width="100%" GroupLoadMode="Server" TableLayout="Fixed" AllowPaging="True" PageSize="20" AllowFilteringByColumn="true">
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="FamilyName" FieldName="FamilyName"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="FamilyName"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                 <Columns>
                 
                         <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
  
                    <telerik:GridBoundColumn SortExpression="FamilyName" HeaderText="Family Name" HeaderButtonType="TextButton"
                        DataField="FamilyName" HeaderStyle-HorizontalAlign="Center" Visible="false" AutoPostBackOnFilter="true">
                         <HeaderStyle Width="15%" />
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn SortExpression="Context" HeaderText="Contact Type" HeaderButtonType="TextButton"
                        DataField="Context">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="OrganisationName" HeaderText="Organisation Name" HeaderButtonType="TextButton"
                        DataField="OrganisationName" >
                        <HeaderStyle Width="32%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="RoleTitle" HeaderText="Role Title" HeaderButtonType="TextButton"
                        DataField="RoleTitle" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Phone" HeaderText="Phone"
                        HeaderButtonType="TextButton" DataField="Phone" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Mobile" HeaderText="Mobile"
                        HeaderButtonType="TextButton" DataField="Mobile">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Fax" HeaderText="Fax"  AutoPostBackOnFilter="true" 
                        HeaderButtonType="TextButton" DataField="Fax">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID"
                        HeaderButtonType="TextButton" DataField="ID" Visible="false">
                    </telerik:GridBoundColumn>
                </Columns>
                  
            </MasterTableView>
            <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="false" AllowDragToGroup="false" 
                AllowColumnsReorder="false" EnableRowHoverStyle="false">
                <Selecting AllowRowSelect="True" />
                  
            </ClientSettings>
              
            </telerik:RadGrid>
Kunal
Top achievements
Rank 1
 answered on 12 Jan 2011
2 answers
158 views
I am using a Filter control that is never bound to a grid or list view.  I have a set of fields that are passed into my user control, and I iterate over those fields to build the FieldEditor controls that I need in my Filter control.  This works well for all the standard FieldEditor types, (ie. boolean, numeric, text) However, I am having trouble populating the choices for editors of type RadFilterCustomEditors.RadFilterDropDownEditor  I am using the following code called from my user controls pre render event.

Dim choices As Dictionary(Of String, String) = New Dictionary(Of String, String)()
choices.Add(
"Yes", "Yes")
choices.Add(
"No", "No")

Dim field As RadFilterCustomEditors.RadFilterDropDownEditor = New RadFilterCustomEditors.RadFilterDropDownEditor()
field.DataSourceID = "????" 'What would go here?
field.DataValueField =
"Key"                       
field.DataTextField =
"Value"

QuestionFilter.FieldEditors.Add(field)
field.FieldName = question.Id                       
field.DisplayName = question.Description

obviously this is incomplete and doesn't work.  I have tried creating a FilterChoice object with a display and value property and binding a list of those to an objectdatasource, but ran into issues there with strings being in the wrong format, and that really isn't the best implementation anyway, so I have abandoned it for the time being.

So my question is in a nutshell, how do I build a list of choices, and bind it to a RadFilterCustomEditors.RadFilterDropDownEditor at run time without being tied to a grid?
Matthew
Top achievements
Rank 1
 answered on 11 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?