Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
183 views
hello,
I would like to manage code behind that when I change the display of rows of the grid, for example from 20 to 30 or 50 lines, automatically changes the height of the grid. I set the default 15 lines and a height of 485px. How can I do?

this is the code that I use when I change the page size

Protected Sub RadGrid1_PageSizeChanged(sender As Object, e As GridPageSizeChangedEventArgs) Handles RadGrid1.PageSizeChanged
    RadGrid1.DataSource = read.GetSchedineData(1, "15-07-2013")
    RadGrid1.Rebind()
End Sub

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Jul 2013
1 answer
91 views
Hi

Any possibility to make the radtreeview to appear like radpanelbar especially its collapse and expand operations.

Thanks
Karl
Princy
Top achievements
Rank 2
 answered on 18 Jul 2013
3 answers
354 views
Is there an example anywhere that shows how to add new items on the client side to the dropdown list?

The documentation seems to be lacking any examples really for the dropdowns client side.
Nencho
Telerik team
 answered on 18 Jul 2013
5 answers
178 views
Hi, I notice that the $telerik.getLocation() returns wrong results. I am using it to get the position of an element on the page so I can put another element at the same position on the page over it. So I am using $telerik.getLocation() et $telerik.setLocation() but the returned location is few pixels less than the real position (as I remember is 4 pixels less in x and y).

When I run my application locally in Visual Studio 2012 using IE8, everything is fine but when I run it from an IIS located on server then like I said I am few pixels away (same browser). I found a workaround by using jquery instead to get the location with:

$telerik.$(element).offset().left; // .top

I still use $telerik.setLocation() to set the position which work.

PS: $telerik.getBounds() have the same problem with x and y.
Danail Vasilev
Telerik team
 answered on 18 Jul 2013
1 answer
116 views
Hi,
I have a user control in a grid which I want to update via ajax.
Scenario: I click on this link which is part of a user control. A pop up window opens up. I enter some details and save it and close pop up. Since the pop is the detailed version of the user control, now, as soon as the link  closes I have a way to make the ajax call and identify the user control and update itself from Db. Right now I can get reference of the control and update it but it does not refresh on UI.Is there anything I am doing wrong here is relevant code..
AjaxManager_AjaxRequest gets called and reference to user control as well but it does not refresh on UI. in code it does get updated by grabbing new values from database. Any ideas..?
Maria Ilieva
Telerik team
 answered on 18 Jul 2013
4 answers
310 views
I have a radgrid with mostly template columns...I have added export feature to the grid, export to pdf works fine with the footer details but with csv export footer is missing I am looking for group footer and grid footer data. Is it possible if so please guide me. thank you
Kostadin
Telerik team
 answered on 18 Jul 2013
14 answers
182 views
I have a radgrid on my page that I create in the Page_Init. It has the MasterTableView along with a hierarchy setup call 'SubCodes'.

In my RadGrid1_ItemDataBound I am customizing the PageSizeComboBox for both the MasterTableView and SubCodes.
    Public Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name <> "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("20"))
            dropDown.FindItemByText("20").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("50"))
            dropDown.FindItemByText("50").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("100"))
            dropDown.FindItemByText("100").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True
        End If
 
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name = "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("1"))
            dropDown.FindItemByText("1").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("2"))
            dropDown.FindItemByText("2").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("5"))
            dropDown.FindItemByText("5").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True
        End If
end sub

The boxes for my MasterTableView and the DetailsTables come up with the correct entries. When I change the entry in one of my SubCodes DetailTables the system does not recall my RadGrid1_NeedDataSource and refresh the screen. It does if I change the entry in the MasterTableView. I believe it has something to do with assigning the ownerTableViewId to e.Item.ClientID for the SubCodes. What should I be doing. Below is the Page_Init function on how I create the radGrid.

RadGrid1.ID = "RadGrid1"
 RadGrid1.Width = Unit.Pixel(1500)
 RadGrid1.Height = Unit.Pixel(700)
 
 RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace
 RadGrid1.AllowPaging = True
 'RadGrid1.AllowCustomPaging = True
 RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
 RadGrid1.AutoGenerateColumns = False
 RadGrid1.ShowStatusBar = True
 RadGrid1.AllowSorting = True
 RadGrid1.AllowFilteringByColumn = True
 RadGrid1.MasterTableView.NoDetailRecordsText = "No records could be found."
 RadGrid1.MasterTableView.NoMasterRecordsText = "No records could be found."
 RadGrid1.MasterTableView.ShowHeadersWhenNoRecords = True
 
 RadGrid1.Skin = "WebBlue"
 RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "GetGridObject"
 RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2
 RadGrid1.ClientSettings.AllowColumnsReorder = True
 RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap
 RadGrid1.ClientSettings.Selecting.AllowRowSelect = True
 RadGrid1.ClientSettings.Resizing.AllowColumnResize = True
 RadGrid1.ClientSettings.Scrolling.AllowScroll = True
 RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
 RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = True
 RadGrid1.ClientSettings.ClientEvents.OnFilterMenuShowing = "filterMenuShowing"
 RadGrid1.FilterMenu.OnClientShowing = "MenuShowing"
 RadGrid1.MasterTableView.PageSize = 100
 
 If ConfigurationManager.AppSettings("geoSelectionGridSize") <> "" Then
     RadGrid1.MasterTableView.PageSize = ConfigurationManager.AppSettings("geoSelectionGridSize")
 Else
     RadGrid1.MasterTableView.PageSize = 50
 End If
 
 RadGrid1.MasterTableView.AllowMultiColumnSorting = True
 RadGrid1.MasterTableView.DataKeyNames = New String() {"DetailID", "Day", "FoundGeographies", "SubZipCount"}
 
 RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand
 RadGrid1.MasterTableView.HierarchyDefaultExpanded = True
 
 Dim dpCounter As Integer = 1
 Dim dpCollection As IList(Of RadListBoxItem) = rlbDistributionPatterns.CheckedItems
 For Each item As RadListBoxItem In dpCollection
     Dim columnGroup As New GridColumnGroup
     columnGroup.HeaderText = item.Text
     columnGroup.Name = "GroupDP" & dpCounter.ToString
     columnGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Center
     RadGrid1.MasterTableView.ColumnGroups.Add(columnGroup)
     dpCounter += 1
 Next
 
 columnCreation("Geography", "Geography", RadGrid1)
 columnCreation("Circ Type", "CirculationTypeDescription", RadGrid1)
 columnCreation("Household", "HouseHold_Count", RadGrid1)
 columnCreation("Total Cov", "TotalCoverage", RadGrid1)
 
 If miZipCodeStoreAssociationTypeID > 0 Then
     columnCreation("Location Market", "LocationMarket", RadGrid1)
     columnCreation("Location Number", "LocationNumber", RadGrid1)
     columnCreation("Location Name", "LocationName", RadGrid1)
     columnCreation("Distance", "Distance", RadGrid1)
     columnCreation("Sales", "Sales", RadGrid1)
     columnCreation("Total Sales", "TotalSales", RadGrid1)
     columnCreation("BOS", "BOS", RadGrid1)
     columnCreation("Cume BOS", "CumeBOS", RadGrid1)
     columnCreation("SPH", "SPH", RadGrid1)
     columnCreation("SPH Index", "SPHIndex", RadGrid1)
 End If
 
 If mstrClientDataCategoryID1Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID1Description.Trim, "CD1", RadGrid1)
 End If
 If mstrClientDataCategoryID2Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID2Description.Trim, "CD2", RadGrid1)
 End If
 If mstrClientDataCategoryID3Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID3Description.Trim, "CD3", RadGrid1)
 End If
 
 If mstrReportDemographicID1Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID1Description.Trim, "Demographic1", RadGrid1)
 End If
 If mstrReportDemographicID2Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID2Description.Trim, "Demographic2", RadGrid1)
 End If
 If mstrReportDemographicID3Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID3Description.Trim, "Demographic3", RadGrid1)
 End If
 If mstrReportDemographicID4Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID4Description.Trim, "Demographic4", RadGrid1)
 End If
 If mstrReportDemographicID5Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID5Description.Trim, "Demographic5", RadGrid1)
 End If
 
 columnCreation("Day", "Day", RadGrid1)
 columnCreation("Selected", "Selected", RadGrid1)
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     columnCreation("Forced", "Forced", RadGrid1)
 End If
 columnCreation("Circ", "Circ", RadGrid1)
 columnCreation("Coverage", "Coverage", RadGrid1)
 
 columnCreation("Zones", "Zones", RadGrid1)
 
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     If miVersionsCategoryID > 0 Then
         columnCreation("Version", "Version", RadGrid1)
         columnCreation("Sub-Version Category", "SubVersionCategory", RadGrid1)
     End If
 
     If miDeliveryCodeCount > 0 Then
         columnCreation("Delivery Code", "DeliveryCode", RadGrid1)
     End If
 
     dpCounter = 1
     For Each item As RadListBoxItem In dpCollection
         columnCreation(item.Text, "DP" & dpCounter.ToString, RadGrid1)
         columnCreation(item.Text, "CoverageDP" & dpCounter.ToString, RadGrid1)
         dpCounter += 1
     Next
 End If
 
 columnCreation("FoundGeographies", "FoundGeographies", RadGrid1)
 
 Dim tableSubCode As New GridTableView(RadGrid1)
 tableSubCode.Name = "SubCodes"
 tableSubCode.DataKeyNames = New String() {"SubCodeID", "Day", "CirculationTypeDescription", "FoundGeographies"}
 tableSubCode.Width = Unit.Percentage(100)
 tableSubCode.AllowFilteringByColumn = False
 
 dpCounter = 1
 For Each item As RadListBoxItem In dpCollection
     Dim columnGroup As New GridColumnGroup
     columnGroup.HeaderText = item.Text
     columnGroup.Name = "GroupDP" & dpCounter.ToString
     columnGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Center
     tableSubCode.ColumnGroups.Add(columnGroup)
     dpCounter += 1
 Next
 
 Dim relationFields1 As GridRelationFields = New GridRelationFields()
 relationFields1.MasterKeyField = "DetailID"
 relationFields1.DetailKeyField = "DetailID"
 tableSubCode.ParentTableRelation.Add(relationFields1)
 RadGrid1.MasterTableView.DetailTables.Add(tableSubCode)
 
 columnSubCodeCreation("SubCode", "Sub_Code", tableSubCode)
 columnSubCodeCreation("Household", "HouseHold_Count", tableSubCode)
 
 If mstrClientDataCategoryID1Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID1Description.Trim, "CD1", tableSubCode)
 End If
 If mstrClientDataCategoryID2Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID2Description.Trim, "CD2", tableSubCode)
 End If
 If mstrClientDataCategoryID3Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID3Description.Trim, "CD3", tableSubCode)
 End If
 
 If mstrReportDemographicID1Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID1Description.Trim, "Demographic1", tableSubCode)
 End If
 If mstrReportDemographicID2Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID2Description.Trim, "Demographic2", tableSubCode)
 End If
 If mstrReportDemographicID3Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID3Description.Trim, "Demographic3", tableSubCode)
 End If
 If mstrReportDemographicID4Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID4Description.Trim, "Demographic4", tableSubCode)
 End If
 If mstrReportDemographicID5Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID5Description.Trim, "Demographic5", tableSubCode)
 End If
 
 columnSubCodeCreation("Selected", "Selected", tableSubCode)
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     columnSubCodeCreation("Forced", "Forced", tableSubCode)
 End If
 columnSubCodeCreation("Circ", "Circ", tableSubCode)
 columnSubCodeCreation("Coverage", "Coverage", tableSubCode)
 
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     dpCounter = 1
     For Each item As RadListBoxItem In dpCollection
         columnSubCodeCreation(item.Text, "DP" & dpCounter.ToString, tableSubCode)
         columnSubCodeCreation(item.Text, "CoverageDP" & dpCounter.ToString, tableSubCode)
         dpCounter += 1
     Next
 End If
 
 Me.PlaceHolder1.Controls.Add(RadGrid1)

Eyup
Telerik team
 answered on 18 Jul 2013
1 answer
216 views
Hi,

I'm using a combination of RadTabStrip and RadPageView and have several RadTextBox, RadComboBoxes and RadButtons in those RadPageViews, and some of those use the RequiredFieldValidatior, RegularExpressionValidator etc. for client-side validation.

The AutoPostBack and CausesValidation properties of the TabStrip is set to 'True' so that whenever the user clicks on a Tab, the validation is fired for the current tab. Also, the TabStrip and PageView are ajaxified using the RadAjaxManagerProxy.

The scenario is : 
- User clicks on the 2nd tab, or any control that causes validation after filling up the details in the first tab.
- A few controls fail validation and the error messages are shown in the ValidationSummary.
- Now, all controls on this tab, that cause postback, do not cause postback on the first attempt. e.g. if the user clicks a RadButton that causes postback, the button now needs to be clicked twice to work. Similarly, if there is a RadCombobox that causes postback, the user needs to make 2 selections in the combobox to have the postback occur.

Why does this happen ? I'm clueless ! Please help me resolve it.


Nishant
Maria Ilieva
Telerik team
 answered on 18 Jul 2013
13 answers
795 views
Hi,

I have radgrid with template column like this ..

<telerik:GridTemplateColumn UniqueName="Template4" HeaderText="= 7, < 21">
      <ItemTemplate>
        <asp:HyperLink ID="HyperLink2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TwentyCount")%>'></asp:HyperLink>                                     
     </ItemTemplate>
</telerik:GridTemplateColumn>

I want to open a rad popup when I am click on hyperlink column.   Rad pop will contain aspx page and grid again. So I want to send parameters also when  I am click on hyperlink column.

If we want open in a new browser directly we can  use this one ..
NavigateUrl='<%#"~/Rpt_Out_DepartmentDaysDue.aspx?UserName= &DaysRange="Seven"&DeptCode=" + DataBinder.Eval(Container.DataItem, "SevenCount").ToString()%>'


But I want to open in a rad popup window. Please help me on this. ..

Thank you in advance ..
Maria Ilieva
Telerik team
 answered on 18 Jul 2013
3 answers
222 views
Hi,


We are designing a reporting window using  Rad-grid for our client which is a departmental store. Now the requirement is that in footer section of Rad-grid, it is required  to show UNIT(PCS,Litres, mitres,,,,,,) wise summary. In the attached snap we have tried to show our exact requirement.

Please help us with suitable code..

Regards
Purojit  .
Antonio Stoilkov
Telerik team
 answered on 18 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?