Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
249 views
I have a radgrid that is being dynamically created, adding 1 row at a time.   One of the columns is a radcombobox which is filled using LINQ.  The prerender event is set for the grid to make all rows editable (for multirowedit functionality).  All of that works fine...the problem is that each time I add a new row to the grid the selectedvalue of the radcombobox for previously entered rows changes to match the selectedvalue for the new row.  How do i get each combobox in each row to retain its correct selectedvalue?  To clarify...the selection of each radcombobox is set using: rcb.Text = "SelectedValueText" where "SelectedValueText" is a value which appears in the radcombobox.  I'm thinking the issue has to do with the prerender event calling rebind which executes itemdatabound for each row in the grid but i'm not sure how to make all columns in a row editable on the row level (as each row is added) as opposed to on the gridlevel.  Can you iterate through the cells in a single row to put in edit mode from within the ItemDataBound event?

Code: VB
    Private Sub rgDataEntry_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgDataEntry.ItemDataBound
        If (Session("DataEntry") Is Nothing) Then
            CreateDataTable()
        End If

        If (TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode) Then
            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim rcb As RadComboBox = CType(item.FindControl("cboFundingCodeEdit"), RadComboBox)
            Dim db As EcotAppsDataContext = New EcotAppsDataContext

            Dim query = From codes In db.FundingCodes
                        Select codes.FundingCode, codes.FundingCodeID Order By FundingCode Order By FundingCode

            For Each x In query
                Dim rcbItem As New RadComboBoxItem(x.FundingCode.ToString)
                rcb.Items.Add(rcbItem)
            Next

            Dim rcbDefaultItem As New RadComboBoxItem(String.Empty)
            rcb.Items.Insert(0, rcbDefaultItem)

            Dim FundCode As String
            FundCode = Convert.ToString(Session("FundingCode"))
            rcb.Text = FundCode

        End If

    End Sub

    Private Sub rgDataEntry_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgDataEntry.PreRender
        If (Session("DataEntry") Is Nothing) Then
            CreateDataTable()
        End If

        For Each item As GridItem In rgDataEntry.MasterTableView.Items
            If TypeOf item Is GridEditableItem Then
                Dim editableItem As GridEditableItem = CType(item, GridDataItem)
                editableItem.Edit = True
            End If
        Next
        rgDataEntry.Rebind()

    End Sub
Radoslav
Telerik team
 answered on 12 Oct 2012
0 answers
213 views
Hi,
I have developed a web site where I have used Telerik Grid .I enabled Filtering for Grid columns.When my Security team ran test with Acunetix Vulnerability Scanner,Filter Text box for a Text column is identified as Vulnerable to SQL Injection.Please advise a solution for this.

Thanks Himagiri
Himagiri
Top achievements
Rank 1
 asked on 12 Oct 2012
3 answers
142 views
Hi , 

 I wanted to open a popup with textbox and a button  when click on radmenuitem .

I know i can achieve it by using radwindow but for radwindow i need to provide a Navigate Url to open it. For that i need to create a new aspx and refer it. 

I want to open a popup div when i click on the radmenuitem instead of creating a new page. 

Is it possible??

Thanks,
Nimmy
Princy
Top achievements
Rank 2
 answered on 12 Oct 2012
1 answer
59 views
Hi,

i am facing one problem with Rad Grid Control. Grid having one column which is field with resources users. So we have two filter types one is for getting resource based on input resoucre name in first  filter. Second filter is for to get resources list based on comment text , we can get the resource details based on comment text  from the query into database and bind into the grid. but first filter is working fine. second filter is not working.
Can you please provide the suitable solution or code as soon as possible.
Thanks .

Please find the GUI attached screenshot in the below.


Andrey
Telerik team
 answered on 12 Oct 2012
1 answer
69 views
I need a help. The attached sample for VB is not fully working from this thread http://www.telerik.com/community/forums/aspnet-ajax/scheduler/multiple-resource-appointment-amp-group-by.aspx
, if I declare Public MustInherit Class SchedulerDBProvider, then I can't declare the instance in code behind. What can i do, your help is really appreciate.

Plamen
Telerik team
 answered on 12 Oct 2012
1 answer
66 views
Can the restrictionZone size be changed dynamically if the browser size is changed?
Princy
Top achievements
Rank 2
 answered on 12 Oct 2012
0 answers
27 views
Hi,

I have a RadGrid with about 5-6 columns.  Two of the columns will be related comboboxes like the following demo.

http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

 

While I have the Related Radcombobox function working fine on multiple pages, I'm having absolutely no luck making this work when Editing or Adding a new item.  Any help would be highly appreciated.

Basically, when the user clicks the image to edit in line, the first dropdown selected will provide the items in the second dropdown.  So, it's kind of a combination of the first link provided and the following grid.

http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/comboingrid/defaultcs.aspx?product=grid

Think a selection of supplier populating a list of categories.

Thank you!

Michael
Michael
Top achievements
Rank 1
 asked on 12 Oct 2012
4 answers
59 views
<td> Tag Display none and display block on Javascript

Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
199 views
hi.

i have a form that i want user can insert rows in it client-side and without any PostBack. and after click on Save button, my application saves all of rows by batch method.
i don't want to use from grid.
my first idea is using from dynamically control creation for any new row.

can you help me?
tanks.
Shinu
Top achievements
Rank 2
 answered on 12 Oct 2012
1 answer
42 views
Hello Group,

I have a question about the radgrid control. The problem is that when I add templatecolumns to the grid from a datatable programmacally then columns aren't visible. The only way there are visible is when I connect de radgrid to an sqldatasource. But the when i click a link in the grid the complete grid vanishes.

Code for the first grid: this one binds fine although very slow but thats is another question.

<telerik:RadGrid ID="RgNav" runat="server" CellSpacing="0" DataSourceID="SDS_PPB_Project"
                        GridLines="None" Skin="Default" AutoGenerateColumns="false" CssClass="PpbNav">
                        <MasterTableView DataSourceID="SDS_PPB_Project" DataKeyNames="DossierCode" HeaderStyle-Height="48"
                            HierarchyDefaultExpanded="true">
                            <DetailTables>
                                <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_Sales" Width="100%"
                                    DataKeyNames="DetailCode,DetailSubCode" ShowHeadersWhenNoRecords="false" HierarchyDefaultExpanded="false">
                                    <DetailTables>
                                        <telerik:GridTableView DataSourceID="SDS_PPB_ProdDossiers" AutoGenerateColumns="false"
                                            DataKeyNames="DetailCode,DetailSubCode,ProdHeaderDossierCode" HierarchyDefaultExpanded="false">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="DetailCode" MasterKeyField="DetailCode" />
                                                <telerik:GridRelationFields DetailKeyField="DetailSubCode" MasterKeyField="DetailSubCode" />
                                            </ParentTableRelation>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="ProdHeaderDossierCode" HeaderText="ProdDossier">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="ProdStatusCode" HeaderText="StatusCode">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="PhQty" HeaderText="Aantal">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <DetailTables>
                                                <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_Operations"
                                                    Width="100%" DataKeyNames="ProdHeaderDossierCode" ShowHeadersWhenNoRecords="false"
                                                    HierarchyDefaultExpanded="false">
                                                    <ParentTableRelation>
                                                        <telerik:GridRelationFields DetailKeyField="ProdHeaderDossierCode" MasterKeyField="ProdHeaderDossierCode" />
                                                    </ParentTableRelation>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="MachGrpCode" HeaderText="Bew.">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ProdBooStatusCode" HeaderText="StatusCode">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="MachPlanTime" HeaderText="Bew.PT">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="OperStartedInd" HeaderText="Gestart">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="OperFinishedInd" HeaderText="Gereed">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="DetailCode" HeaderText="Vk.Rgl">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DetailSubCode" HeaderText="SubRgl">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DDDescription" HeaderText="Omschrijving">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DDCalcQty" HeaderText="Aantal">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DDCompletedInd" HeaderText="Gereed">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                    <DetailTables>
                                        <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_Delivery"
                                            Width="100%" DataKeyNames="DetailCode,DetailSubCode,DelMainCode" ShowHeadersWhenNoRecords="false"
                                            HierarchyDefaultExpanded="false">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="DetailCode" MasterKeyField="DetailCode" />
                                                <telerik:GridRelationFields DetailKeyField="DetailSubCode" MasterKeyField="DetailSubCode" />
                                            </ParentTableRelation>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="DelMainCode" HeaderText="HVS">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="DelDescription" HeaderText="Omschrijving">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                            <DetailTables>
                                                <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_DeliveryLines"
                                                    Width="100%" DataKeyNames="DelMainCode" ShowHeadersWhenNoRecords="false" HierarchyDefaultExpanded="false">
                                                    <ParentTableRelation>
                                                        <telerik:GridRelationFields DetailKeyField="DelMainCode" MasterKeyField="DelMainCode" />
                                                    </ParentTableRelation>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="DelLineQty" HeaderText="Aantal">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="DelLineCompletedInd" HeaderText="Gereed">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                </telerik:GridTableView>
                            </DetailTables>
                            <Columns>
                                <telerik:GridBoundColumn DataField="QuotNr" HeaderText="OfferteNr.">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="OrdNr" HeaderText="OrdNr.">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="DmDescription" HeaderText="Project">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <DetailTables>
                                <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_AllDelivery"
                                    Width="100%" DataKeyNames="DelMainCode" ShowHeadersWhenNoRecords="false">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="DelMainCode" HeaderText="HVS">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DelDescription" HeaderText="Omschrijving">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                    <DetailTables>
                                        <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_DeliveryLines"
                                            Width="100%" DataKeyNames="DelMainCode" ShowHeadersWhenNoRecords="false">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="DelMainCode" MasterKeyField="DelMainCode" />
                                            </ParentTableRelation>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="DelLineQty" HeaderText="Aant.">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="DelLineCompletedInd" HeaderText="Gereed">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                </telerik:GridTableView>
                            </DetailTables>
                            <DetailTables>
                                <telerik:GridTableView AutoGenerateColumns="false" DataSourceID="SDS_PPB_Invoices"
                                    Width="100%" ShowHeadersWhenNoRecords="false">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="InstNr" HeaderText="Termijn">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="InstDescription" HeaderText="Omschrijving">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </telerik:GridTableView>
                            </DetailTables>
                        </MasterTableView>
                    </telerik:RadGrid>

The second grid should generate the same template structure as the first one with weeknames as columns. The code for the second radgrid columns generation: This grid is added statically to the page.

Private Sub SetColumnHeaders_v2()
        Dim Dt As DataTable = GetTimeTableWeeks_v2(PhaseId)
        Dim TemplateColumn As GridTemplateColumn = Nothing
        For Each dr As DataRow In Dt.Rows
            TemplateColumn = New GridTemplateColumn
            With TemplateColumn
                .HeaderText = dr.Item(0).ToString.Trim
                .HeaderStyle.Width = 20000
            End With
            RgMain.Columns.Add(TemplateColumn)
        Next
End Sub



Please help.

René
Shinu
Top achievements
Rank 2
 answered on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?