Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
276 views
I created a project using RagGrid with advanced databinding and custom paging (like the top example here: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/custompaging/defaultcs.aspx) except I have viewstate for the grid disabled. My issue is when I change my page size the grid doesn't really update like it should (I'm using the default page sizes).

By default it's on 10, if I select 20 my grid rebinds but page size is still 10 in the NeedDataSource event. From there if I select page size 50, my grid rebinds but page size is 20 in NeedDataSource. The wierd part is if I select page size 10 from either of those I always get the correct page size / number of records.

I traced the events and in my scenario it looks like PageSizeChanged is being fired but the grid isn't rebinding afterwards, although it clearly rebinds correctly after PageIndexChanged.

Any help would be greatly appreciated. Thanks.
Andrey
Telerik team
 answered on 11 Mar 2013
3 answers
99 views
Current I made a grid with 2 combobox, I wanna to refresh the b combobox when the a combobox is onchange.

as my issue, I cannot refresh the combobox of "Enabled", when I set in code behind.

Eyup
Telerik team
 answered on 11 Mar 2013
1 answer
149 views
After upgraded the Telerik ASP.Net AJAX controls to the latest release, ie, 2013.1.220.40,  I've noticed the following issues so far, which were not there in the previous version.

      1. RadComboBox         
              The items in the drop down part showing within a container with horizontal and vertical scroll.
 
      2. Radconfirm
             At present we are using the following function for rad confirm, It was working perfectly in the previous versions.
             The confirm window shows but when click on "Ok" button, the click event not firing.
                                  //RadConfirm                              
			function OnClientClicking(sender, args) {
				var callBackFunction = Function.createDelegate(sender, function (argument) {
					if (argument) {
						this.click();
					}
				});
				var text = "Are you sure you want to submit?";
				radconfirm(text, callBackFunction, 350, 100, null"RadConfirm");
				args.set_cancel(true);
			}
   
      3. Radbutton
             Ajax loading panel not showing if the button is associated with a asp validation group. Otherwise loading panel working
             perfectly.


   Please look on this issue and the fix would be very appreciate.
 
Thanks.       





 

Marin Bratanov
Telerik team
 answered on 11 Mar 2013
1 answer
180 views
Hi,
I am having a problem with GridTemplateColumn aligning to the center on altRows and to the left on Rows. This is not what I want and I can't see any way to change it.
I am using Telerik.Web.UI.dll and skins.dll versions 2012.3.1016.40; 

aspx file:
<telerik:RadGrid Skin="Office2010Silver" CSSClass="GreenCustom">

.css file:
/* GreenCustom style for grid Office2010Silver = Happened */
.GreenCustom .rgRow a
{
    text-align: left;
    vertical-align: text-top;
    color: #F00;
}

.GreenCustom .rgAltRow a
{
    text-align: left;
    vertical-align: text-top;
    color: #FFF;
}

.GreenCustom .rgSelectedRow td
{
    text-align: left;
    vertical-align: text-top;
    background:  #FFF;
    border: solid 1px #e5e5e5;
    border-top: solid 1px #e9e9e9;
    border-bottom: solid 4px white;
    padding-left: 4px;
    color:#0F0;
}

.GreenCustom .rgHoveredRow td
{
    text-align: left;
    vertical-align: text-top;
    background:none;
    background-image:none;
    background-color:#CC2064;
    color:#0F0;
}

some of the GridTemplateColumn ItemTemplate columns have labels, some have hyperlinks,

The rows are aligned as I want to the top left and the alt rows are all aligned to the centre centre which I don't want.
Checking with view source the html I am finding:
<tr class="rgRow" valign="top" id="gridSearchResults_ctl00__2" style="text-align:left;">
<tr class="rgAltRow" id="gridSearchResults_ctl00__3">

I am wasting a lot of time on a product that I have never enjoyed using.
Any help gratefully received.
Patrick
Top achievements
Rank 1
 answered on 11 Mar 2013
8 answers
736 views

Hi Telerik team;

I have a master grid and a detail grid in my aspx page.  I have edit and insert set up in the detail grid.  I have added required field validator in the code behind for the text box.  I am running into an issue with validation happening on both edit and insert mode at the same time when any text is not entered in the text box in both the modes and any of the update or insert buttons are clicked.  The grid allows both the edit and insert modes to be turned on at any time.  I have attached a screen shot in order to help explain it better.  Is there any way, that the validation could be performed only in edit or insert mode at any time or just to turn edit or insert mode only and not allow both of these to be enabled?  I have also attached my code that I have for this.

Thanks in advance.  Any help would be appreciated.

Meera

aspx page:

 

<telerik:RadGrid ID="viewGrid" runat="server" ActiveItemStyle-BorderColor="ActiveBorder" 
                                        ShowStatusBar="True" AllowSorting="true" ItemStyle-BorderWidth="1px" OnSortCommand="viewGrid_Sort" 
                                        MasterTableView-ExpandCollapseColumn-CollapseImageUrl="~/App_Themes/Images/Content/collapse.gif"   
                                        MasterTableView-ExpandCollapseColumn-ItemStyle-CssClass="textalignleft"   
                                        MasterTableView-ExpandCollapseColumn-ButtonType="ImageButton"   
                                        MasterTableView-ExpandCollapseColumn-ExpandImageUrl="~/App_Themes/Images/Content/expand.gif" 
                                        OnUpdateCommand="viewGrid_UpdateCommand" Width="900px" 
                                        MasterTableView-ExpandCollapseColumn-ItemStyle-HorizontalAlign="Center" OnItemCreated="viewGrid_ItemCreated" 
                                        MasterTableView-ExpandCollapseColumn-ItemStyle-VerticalAlign="Middle" OnItemDataBound="viewGrid_DataBound" 
                                        MasterTableView-ExpandCollapseColumn-ItemStyle-Width="2%" OnDetailTableDataBind="viewGrid_DetailTableDataBind"   
                                        OnNeedDataSource="viewGrid_NeedDataSource" OnPreRender="viewGrid_PreRender"   
                                         OnInsertCommand="viewGrid_InsertCommand" AllowMultiRowEdit="false">  
                                        <MasterTableView AutoGenerateColumns="False" HierarchyLoadMode="ServerBind" 
                                         DataKeyNames="DomainName,ParentDomainValue" Name="Master" > 
                                             <DetailTables> 
                                             <telerik:GridTableView DataKeyNames="DomainName,ParentDomainName,ParentDomainValue,DomainValue" Name="DomainLabel"   
                                                AutoGenerateColumns="false" BorderStyle="None" ItemStyle-BorderWidth="0px" AllowSorting="false"   
                                                ShowHeader="false" Width="900px" 
                                                CommandItemDisplay="Top" EditMode="InPlace">  
                                                <ParentTableRelation> 
                                                <telerik:GridRelationFields DetailKeyField="DomainName" MasterKeyField="DomainName" /> 
                                                </ParentTableRelation> 
                                                <CommandItemSettings AddNewRecordText="<%$ Resources:DomainAdmin, locAddDomainValue %>" /> 
                                                <Columns> 
                                                    <telerik:GridTemplateColumn UniqueName="DomainLabelcol" > 
                                                    <ItemTemplate> 
                                                            <asp:Label ID="plSubject" runat="server" Text="Domain Values"/>  
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="150px" Wrap="false" HorizontalAlign="Left" CssClass="panelstyle"   
                                                     ForeColor="#62267f" Font-Bold="true"/>  
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridBoundColumn UniqueName="DomainValue" DataType="System.String" 
                                                        DataField="DomainValue" ColumnEditorID="GridTextBoxColumnEditor1" 
                                                        ItemStyle-HorizontalAlign="Left" 
                                                        ItemStyle-Wrap="false" 
                                                        ItemStyle-Width="300px">  
                                                    </telerik:GridBoundColumn> 
                                                    <telerik:GridCheckBoxColumn DataField="ActiveFlag" UniqueName="ActiveFlag"   
                                                        DataType="System.Boolean"    
                                                        ItemStyle-HorizontalAlign="Left" 
                                                        ItemStyle-Wrap="false" 
                                                        ItemStyle-Width="20px">   
                                                    </telerik:GridCheckBoxColumn> 
                                                    <telerik:GridTemplateColumn UniqueName="DomainLabelcol" > 
                                                    <ItemTemplate> 
                                                        <asp:Label ID="lblActive" Text="Active" runat="server" CssClass="ActiveLabelStyle" /> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="130px" Wrap="false" HorizontalAlign="Left" /> 
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridEditCommandColumn ButtonType="ImageButton"   
                                                        EditImageUrl="../App_Themes/Images/Buttons/domain_pur_edit.gif" 
                                                        InsertImageUrl="../App_Themes/Images/Buttons/domain_gr_insert.gif" 
                                                        CancelImageUrl="../App_Themes/Images/Buttons/domain_gr_cancel.gif" 
                                                        UpdateImageUrl="../App_Themes/Images/Buttons/domain_gr_update.gif" 
                                                        UniqueName="EditDomainValueColumn" 
                                                        ItemStyle-HorizontalAlign="Right" 
                                                        ItemStyle-Wrap="false" 
                                                        ItemStyle-Width="200px">  
                                                    </telerik:GridEditCommandColumn> 
                                                    <telerik:GridCheckBoxColumn DataField="EditableFlag" UniqueName="EditFlag"   
                                                        DataType="System.Boolean" Visible="false" >   
                                                    </telerik:GridCheckBoxColumn> 
                                                      
                                                </Columns> 
                                            </telerik:GridTableView> 
                                            </DetailTables> 
                                            <Columns> 
                                                <telerik:GridBoundColumn UniqueName="DomainName" DataType="System.String" HeaderText="<%$ Resources:DomainAdmin, locDomainName %>" 
                                                    DataField="DomainName" SortExpression="DomainName"   
                                                    ItemStyle-HorizontalAlign="Left" 
                                                    HeaderStyle-Width="200px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="#62267f" ItemStyle-Width="200px" 
                                                    SortAscImageUrl="~/App_Themes/Images/Buttons/arrow_sort_up.png"   
                                                    SortDescImageUrl="~/App_Themes/Images/Buttons/arrow_sort_down.png" 
                                                    > 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn UniqueName="ParentDomainName" DataType="System.String" 
                                                    HeaderText="<%$ Resources:DomainAdmin, locParentDomainName %>" DataField="ParentDomainName"   
                                                    SortExpression="ParentDomainName" 
                                                    ItemStyle-HorizontalAlign="Left" 
                                                    HeaderStyle-Width="300px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="#62267f" ItemStyle-Width="300px" 
                                                    SortAscImageUrl="~/App_Themes/Images/Buttons/arrow_sort_up.png"   
                                                    SortDescImageUrl="~/App_Themes/Images/Buttons/arrow_sort_down.png">                                                      
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn UniqueName="ParentDomainValue" DataType="System.String" HeaderText="<%$ Resources:DomainAdmin, locParentDomainValue %>" 
                                                    DataField="ParentDomainValue" SortExpression="ParentDomainValue" 
                                                    ItemStyle-HorizontalAlign="Left" 
                                                    HeaderStyle-Width="300px" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="#62267f" ItemStyle-Width="300px" 
                                                    SortAscImageUrl="~/App_Themes/Images/Buttons/arrow_sort_up.png"   
                                                    SortDescImageUrl="~/App_Themes/Images/Buttons/arrow_sort_down.png">  
                                                </telerik:GridBoundColumn> 
                                            </Columns> 
                                            <AlternatingItemStyle Wrap="false"/>  
                                            <ItemStyle Wrap="false"/>  
                                            <RowIndicatorColumn Visible="False">  
                                                <HeaderStyle Width="20px" /> 
                                            </RowIndicatorColumn> 
                                            <ExpandCollapseColumn ButtonType="ImageButton">  
                                            </ExpandCollapseColumn> 
                                            <EditFormSettings> 
                                                <PopUpSettings ScrollBars="None" /> 
                                            </EditFormSettings> 
                                        </MasterTableView> 
                                    </telerik:RadGrid> 

 

code behind:

 

protected void viewGrid_ItemCreated(object sender, GridItemEventArgs e)  
{  
     if (e.Item.OwnerTableView.Name == "DomainLabel")  
     {  
     //Add requiredfieldvalidator for insert and edit.  
      if ((e.Item is GridEditableItem) && e.Item.IsInEditMode)  
      {  
          GridEditableItem editItem = (GridEditableItem)e.Item;  
          TextBox txtbx = (TextBox)editItem["DomainValue"].Controls[0];  
          txtbx.ID = "TextValidated";  
 
          RequiredFieldValidator reqfdvalidtr = new RequiredFieldValidator();  
          reqfdvalidtr.ID = "RequiredFieldValidator1";  
          reqfdvalidtr.ErrorMessage = "Required";  
          reqfdvalidtr.ControlToValidate = "TextValidated";  
          editItem["DomainValue"].Width = Unit.Pixel(100);  
          editItem["DomainValue"].Controls.Add(reqfdvalidtr);  
 
      } 
     }
}

Kostadin
Telerik team
 answered on 11 Mar 2013
1 answer
146 views
Hi,

I have the following scenario. There is a radtextbox(Read Only) in my account page that contains balance info. when user login, initially the textbox should display something like Click to show value. Once the user click inside the textbox, the amount in currency should be displayed. How to achieve the requirement?

Regards,
Damian.
Princy
Top achievements
Rank 2
 answered on 11 Mar 2013
1 answer
94 views
I have a grid with autogeneratedcolumns = true and I have a details table inside of that grid with autogeneratedcolumns = true, have a dropdown box where user selects a particular month, every time the month changes the field names and values of the parent and detail grid change. So if for example selected month is Feb, 2013, set of generated fields would be "sales_12_2012", "sales_1_2013", sales_2_2013" and when I expend detail table it would have similar fields with an addition of some detail information like employee name for example ("empname", "sales_details_1_2013", "sales_details_2_2013", sales_details_3_2013"), and when the selected month would change to Mar, 2013 the set of generated fields would become "sales_1_2013", "sales_2_2013", sales_3_2013"...
As user gets to the page originally everything works fine, user expends the detail table and proper columns are shown (by default current month is selected so it's March, 2013 and therefore it shows: "empname", "sales_details_1_2013", "sales_details_2_2013", sales_details_3_2013") but if user then changes the month to Feb, 2013 for example, so query changes and has the following fields now: "empname", "sales_details_12_2012", "sales_details_1_2013", sales_details_2_2013", but when user expends the detail table again, the set of columns is still the same ("empname", "sales_details_1_2013", "sales_details_1_2013", sales_details_3_2013") as the original one in the details grid. Main "parent" grid works fine.

Please help, it's urgent. Thanks.

ASPX code:
<telerik:RadComboBox ID="rcbMonth" AutoPostBack="True"
            CausesValidation="False"
            Rows="1" runat="server">
        </telerik:RadComboBox>
<telerik:RadGrid ShowGroupPanel="false" AutoGenerateColumns="True" ID="RadGrid1"
            AllowFilteringByColumn="False" AllowSorting="false"
            ShowFooter="True" runat="server" GridLines="None" AllowPaging="false" EnableLinqExpressions="false"
            FooterStyle-BackColor="LightGray"
            >
            <ExportSettings HideStructureColumns="False" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                <Excel Format="Html" />
            </ExportSettings>
            <MasterTableView Name="ParentGrid" DataKeyNames="Name" ShowGroupFooter="true" AllowMultiColumnSorting="true" CommandItemDisplay="Top"
                    CommandItemSettings-ShowAddNewRecordButton="False"
                    CommandItemSettings-ShowRefreshButton="False" ShowFooter="True">
                <CommandItemSettings ShowExportToWordButton="False" ShowExportToExcelButton="true"
                ShowExportToCsvButton="False" />
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="NameDetail" runat="server" AutoGenerateColumns="True"
                        Name="Details" ShowFooter="False"
                        AllowPaging="False" HorizontalAlign="center"
                        GridLines="None">
                        <Columns>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


VB Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not Page.IsPostBack Then
            Dim reportdefaultdate As Date = DateAdd("m", -1, DateTime.Now.Date)
            Dim reportdefaultmonth As Date = CDate(CStr(Month(reportdefaultdate)) & "/1/" & CStr(Year(reportdefaultdate)))
            Dim loopdate As Date = reportdefaultmonth.Date
            Do While loopdate >= CDate("7/1/2012")
                Dim item As New RadComboBoxItem()
                item.Text = MonthName(Month(loopdate)) & ", " & Year(loopdate)
                item.Value = loopdate
                rcbMonth.Items.Add(item)
                loopdate = DateAdd("m", -1, loopdate)
            Loop
        End If
    End Sub
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
         Dim var_monthval As Date = rcbMonth.SelectedValue
         sql= " select "
         Dim loopdate As Date = DateAdd("m", -2, var_monthval)
         Dim var_columnname As String = ""
         Dim i As Integer = 0
         Do While loopdate <= CDate(var_monthval)
              i += 1
              var_columnname = "sales_" & Month(loopdate) & "_" & Year(loopdate)
              If i > 1 Then sql += ","
              sql += " sales as " & var_columnname
              loopdate = DateAdd("m", 1, loopdate)
         Loop
         sql += " from table where month between '" & DateAdd("m", -2, var_monthval) & "' and '" & var_monthval & "' "
        RadGrid1.DataSource = GetDataTable(Sql)
    End Sub
 
Private Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind
         Dim var_monthval As Date = rcbMonth.SelectedValue
         Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
         Dim var_datakeyval As String = dataItem.GetDataKeyValue("Name").ToString()
         sql= " select name "
         Dim loopdate As Date = DateAdd("m", -2, var_monthval)
         Dim var_columnname As String = ""
         Do While loopdate <= CDate(var_monthval)
              var_columnname = "sales_" & Month(loopdate) & "_" & Year(loopdate)
              sql += " , sales as " & var_columnname
              loopdate = DateAdd("m", 1, loopdate)
         Loop
         sql += " from table where month between '" & DateAdd("m", -2, var_monthval) & "' and '" & var_monthval & "' and name = '" &  var_datakeyval & "' "
        e.DetailTableView.DataSource = GetDataTable(Sql)
End Sub
 
Protected Sub rcbMonth_IndexChanged(ByVal sender As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs) Handles rcbMonth.SelectedIndexChanged
        RadGrid1.MasterTableView.Rebind()
    End Sub
 
Public Function GetDataTable(ByVal query As String) As DataTable
        Dim conn As SqlConnection = New SqlConnection(ConnString)
        Dim adapter As SqlDataAdapter = New SqlDataAdapter
        adapter.SelectCommand = New SqlCommand(query, conn)
        Dim table1 As New DataTable
        conn.Open()
        Try
            adapter.Fill(table1)
        Finally
            conn.Close()
        End Try
        Return table1
    End Function
Pavlina
Telerik team
 answered on 11 Mar 2013
1 answer
135 views
Hello,

Please let me know if it is possible to set a global skin for all RadControls in my web application instead of setting the skin property to individual RadControls?

Thank you,
Merlin.
Princy
Top achievements
Rank 2
 answered on 11 Mar 2013
3 answers
89 views
Hi

We have a project built in VS 2005 on the .NET 2.0 framework, and we are to upgrade it to VS 2012 .

This project is using the Telerik RadControls for ASP.NET Q1 2009.


Does anyone have any idea what issues will we face?

Thanks
Paul
Chavdar Dimitrov
Telerik team
 answered on 11 Mar 2013
5 answers
151 views
Hi,

    In my project am using rad scheduler, for binding scheduler am using webservice and am also using user control for Advance form insert/edit.

    In my user control i have added few more controls as per our project requirement. 
While inserting i want to pass those additional infromation to the web service. 

    I have created a class by inheriting SchedulerInfo class as below, but dont know how to assign values to that class form jquery. 

    public class MySchedulerInfo : SchedulerInfo
{
    public int EventId { get; set; }

public MySchedulerInfo(ISchedulerInfo baseInfo, int eventID)
{
  EventId = eventID;
}
}

Am using jquery to call web service for insert & edit methods. In jquery we are able to set default values like description, subject, start time, end time and recurrence rule to the appointment object. But dont know how to pass the other informations to web service to insert/edit.

       Any one please provide some documents how to pass extra parameters to web services.

With Regards,
Nishanth.P
Nishanth
Top achievements
Rank 1
 answered on 11 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?