Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
300 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
175 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
204 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
781 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
213 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
4 answers
654 views
Hi,

In radgrid to allow row selection we are adding following lines of code in the grid

<

 

ClientSettings>

 

 

<Selecting AllowRowSelect="True"></Selecting>

 

 

<ClientEvents OnRowDblClick ="RowSelectedCarrierName" ></ClientEvents>

 

 

</ClientSettings>

 


I want implement this event on cell click. for each cell click in a grid I want call a script and want access the value of selected cell.
How can I do this?

Thanks in advance,
Medac
Venelin
Telerik team
 answered on 18 Jul 2013
6 answers
454 views
I have a radgrid in batch cell edit mode using advanced databinding and I can not get any of the itemUpdate, itemDeleted itemCommand to fire?  Does batch editing not work with advanced databinding?  Wiill it only work with a datasource??

Konstantin Dikov
Telerik team
 answered on 18 Jul 2013
2 answers
155 views
I'm struggling to find a way to retrieve if any cell has really been modified through batch editing.
I'd like to show the SAVE CHANGES and CANCEL CHANGES buttons, only if some editing really took place.
I already found to show/hide a button inside a toolbar in the Command Item template but I'm struggling to know if is there any cell that have been modified (when the little red triangle in the corner appear).
I went down to the ._changes object but with no much luck since the object is empty at start but if you modify a cell and then revert it back to initial value, the ._changes object is no more empty even if no red triangles appear and no batch editing happened after all.

Here is what I come up with so far (but it doesn't work for the reason above):

function ShowBatchUpdateButton() {
    var toolBar = $find("RadToolBar1");
    var button = toolBar.findItemByText("Nuovo");
    var grid = $find("<% = RadGrid1.ClientID %>");
    if (!jQuery.isEmptyObject(grid.get_batchEditingManager()._changes)) {
        button.set_cssClass("ShowGridCommandBarButton")
    } else {
        button.set_cssClass("")
    }
}

How can I spot if there are any red marks on the grid? (because this is what I'm looking for to show/hide the UPDATE and CANCEL buttons in real time)
Massimiliano
Top achievements
Rank 1
 answered on 18 Jul 2013
2 answers
134 views
Hi,
I got a problem with radcombox like here:
addReportDocByVTHS.ascx
<
telerik:RadComboBox ID="ddltype" runat="server" Label="Doc Type: " Width="200px">
</telerik:RadComboBox>
and in my parent usercontrol i call addReportDocByVTHS.ascx like this:
UserControl_ReportDoc_addReportDocByVTHS control = (UserControl_ReportDoc_addReportDocByVTHS)this.Page.LoadControl("~/Usercontrol/ReportDoc/addReportDocByVTHS.ascx");
        if (control != null)
        {         
            control.modalContainer = pnlInsert_ModalPopupExtender.ID.ToString();
            control.AfterClickLuu += new EventHandler(btsearch_Click);
            if (!pnlInsert_child.Controls.Contains(control))
            {
                pnlInsert_child.Controls.Add(control);
                pnlInsert_ModalPopupExtender.Show();
            }
            Session["action"] = "insert";
        }
//load dropdownlist
ddltype.DataSource = F_DocType.GetList();
        ddltype.DataTextField = "DOC_TYPENAME";
        ddltype.DataValueField = "DOC_TYPE";
        ddltype.DataBind();
here is my parent usercontrol.ascx like:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:HiddenField ID="hdfMacv" runat="server" />   
<asp:ModalPopupExtender ID="pnlInsert_ModalPopupExtender" runat="server"
     Enabled="True" TargetControlID="hdfMacv" PopupControlID="pnlInsert"
    BackgroundCssClass="modalBackground" 
    ></asp:ModalPopupExtender>
    
<asp:Panel ID="pnlInsert" runat="server" CssClass="ModalWindow"  style="display:none">   
        <asp:PlaceHolder ID="pnlInsert_child" runat="server" EnableViewState="false">
        </asp:PlaceHolder>
</asp:Panel>
    </ContentTemplate>
    </asp:UpdatePanel

My combobox can't shown down when i click, i only can press "up" and "down" keyboard to choose.
would I miss anything.please tell me. thanks

trunghth
Top achievements
Rank 1
 answered on 18 Jul 2013
5 answers
175 views
Hello,
I need to have information on loading speed records in a grid.
 it is better to load the data with a webserviceor use a simple databinding or for example a databinding to datareader or arrylist?
Maria Ilieva
Telerik team
 answered on 18 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?