Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views
Hi!

I want to preserve my expanded items on a hierarchical RadGrid while I rebind it on the client side.

    var masterTable = $find("ctl00_ctl00_cphCategoryContent_cphContent_rgvRollen").get_masterTableView();
var dataItems = masterTable.get_dataItems();

My problem is, that every item's "get_expanded()" returns false, even if it's expanded. My HierarchyLoadMode is set to "Client".
Mira
Telerik team
 answered on 09 Sep 2010
3 answers
115 views
hi
i use LINQ
and i use IQueryable for datasource
when i use grouping ,filtering and go to the next page radgrid' datasource be null
and i must Bind grid otherTime
Iana Tsolova
Telerik team
 answered on 09 Sep 2010
9 answers
129 views
Hi,

Im trying to implement this on one of my rad grids. http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

However this doesn't work and throws  a " 

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.



Would anybody know a workaround this issue? The grid needs to be wrapped in an ajax panel due to the updates that it does while scrolling or filtering.  But i'd also would like to be able to edit entries usint that methodology or something that looks very similar.

Thanks
Rafal

<telerik:RadAjaxPanel  ID="uPanel" EnableAJAX="true" Width="100%" runat="server">
          <MyGrid:MyRadGrid id="grvTypeList"
                    OnNeedDataSource="GrvTypeList_NeedData"
                    OnItemDataBound="GrvTypeList_ItemDataBound"                  
                                
                    PageSize="30"
                    AllowSorting="true"
                    runat="server">
                   
                    <MasterTableView UniqueName="miscInfoTypeID" >
                   
                        <NoRecordsTemplate>
                         <div style="clear:both;text-align:center;padding:5px;">
                          <asp:Label CssClass="heading2" ID="labelNoRecords" ForeColor="Red" Text="None Found" runat="server" />
                         </div>
                        </NoRecordsTemplate>
                 
                        <Columns>
                            <MyGrid:MyCheckboxColumn  UniqueName="MiscInfoTypeIDCheckbox" DataField="miscInfoTypeID" HeaderStyle-Width="25"  RowSelector="true"  />
                            <telerik:GridBoundColumn DataField="miscInfoType"  SortExpression="miscInfoType" HeaderText="Miscellaneous Type" HeaderStyle-Width="150" />
                            <telerik:GridBoundColumn DataField="exampleInfo" SortExpression="exampleInfo" HeaderText="Example Info" HeaderStyle-Width="100%" />
                            <telerik:GridEditCommandColumn  UniqueName="EditCommandColumn" HeaderText="Action">
                          <HeaderStyle Font-Bold="true" Width="50px" />
                         
                         </telerik:GridEditCommandColumn >
                  
                        </Columns>
                       
                     <EditFormSettings UserControlName="MiscTypeControl.ascx" EditFormType="WebUserControl">
                            <EditColumn  UniqueName="EditCommandColumn">
                            </EditColumn>
                        </EditFormSettings>
               
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="miscInfoType" SortOrder="Ascending" />
                        </SortExpressions>
                    </MasterTableView>
                   
                    <ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick" />
                    </ClientSettings> 
                       
                </Mygrid:MyRadGrid>
                <div style="display:none;">
                    <asp:Button ID="buttonDoPostback" OnClick="buttonDoPostback_Click" runat="server" />
                </div>
            
            </telerik:RadAjaxPanel>
        </div> 
Iana Tsolova
Telerik team
 answered on 09 Sep 2010
1 answer
125 views
Hi,

All I want to achieve is a vertical presentation of data in RadGrid (after click on select in RD). I like the way data is shown when I click on edit in RadGrid. I would like to get the same effect but exclude possibility of changing data + hide update/cancel button. Ideally when controls shown data would be blocked. If it's impossible please advise an alternative.

Best Regards,

Darek
Dimo
Telerik team
 answered on 09 Sep 2010
1 answer
174 views
i have problem ClientEvents-OnCommand does not fire ItemCommand 

i use v 2010.2.908.35


this is my code

 function OnCommand(sender, args)
 {

            if (args.get_commandName() == "RebindGrid")
            {
                var tree = $find("<%=RadPanelBar2.ClientID%>").findItemByValue("the_value2").findControl("RadTreeView1");

                alert(tree.get_checkedNodes().length);
                if (tree.get_checkedNodes().length <= 0) {
                    args.set_cancel(true);
                }

        }
 }


when the commandName = "RebindGrid"  do postback  but  it does not fire itemcomamnd
         
but when the commandName =  any thing else it  do postback  and  fire itemcomamnd


and how can i get the ticket #212372.

thanks
Rosen
Telerik team
 answered on 09 Sep 2010
1 answer
197 views
HI iam using radgrid control.Iam getting error in itemdatabound please check once.Below is the Cs code.

Iam getting error at this code  in itemdatabound.Previously it has worked fine but it is not working now.(Error is Object is not referenced)
Dim solutionId As Integer = CType(CType(row.FindControl("LblSolutionResultId"), Label).Text, Integer)



        <telerik:RadGrid ID="rgResultRanges" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="98%" BorderWidth="3px"

            GridLines="None" OnNeedDataSource="rgResultRanges_NeedDataSource" OnUpdateCommand="rgResultRanges_Update"

            OnInsertCommand="rgResultRanges_Insert" OnDeleteCommand="rgResultRanges_Delete"

            OnItemDataBound="rgResultRanges_ItemDataBound">

            <MasterTableView DataKeyNames="SolutionResultRangeID" CommandItemDisplay="Top">

                <CommandItemTemplate>

                    <asp:Button ID="BtnAdd" runat="server" Text="Add Result Combination For Selected Solution Type"

                        CommandName="InitInsert" />

                </CommandItemTemplate>

                <Columns>

                    <telerik:GridButtonColumn CommandName="Edit" ButtonType="ImageButton" ImageUrl="~/Images/pencil.png"

                        ItemStyle-Width="20px" ItemStyle-HorizontalAlign="Center">

                    </telerik:GridButtonColumn>

                    <telerik:GridTemplateColumn UniqueName="Result1" DataField="Result1" HeaderText="Result #1"

                        SortExpression="Result1">

                        <ItemTemplate>

                            <asp:Label ID="LblResult1" runat="server" />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlResult1" runat="server" />

                            <asp:RequiredFieldValidator ID="ResultValidator" runat="server" Display="Dynamic"

                                ControlToValidate="ddlResult1" ErrorMessage="Result Feild is Required" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Operator1" DataField="Operator1" HeaderText="Op">

                        <ItemTemplate>

                            <asp:Label ID="LblOperator1" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlOperator1" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text=">" Value=">" />

                                <asp:ListItem Text="<" Value="<" />

                                <asp:ListItem Text="=" Value="=" />

                            </asp:DropDownList>

                            <asp:RequiredFieldValidator ID="OperatorValidator" runat="server" Display="Dynamic"

                                ControlToValidate="ddlOperator1" ErrorMessage="Operator is Required" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Value1" DataField="Value1" HeaderText="Val">

                        <ItemTemplate>

                            <asp:Label ID="LblValue1" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:TextBox ID="TxtValue1" runat="server"  />

                            <asp:RequiredFieldValidator ID="ValueValidator" runat="server" Display="Dynamic"

                                ControlToValidate="TxtValue1" ErrorMessage="Value is Required" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Join1" DataField="Join1" HeaderText="Join #1">

                        <ItemTemplate>

                            <asp:Label ID="LblJoin1" runat="server" />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlJoin1" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text="AND" Value="AND" />

                                <asp:ListItem Text="OR" Value="OR" />

                            </asp:DropDownList>

                            <asp:RequiredFieldValidator ID="JoinValidator" runat="server" Display="Dynamic" ControlToValidate="ddlJoin1"

                                ErrorMessage="Join is Required" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Result2" DataField="Result2" HeaderText="Result #2"

                        SortExpression="Result2">

                        <ItemTemplate>

                            <asp:Label ID="LblResult2" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlResult2" runat="server" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Operator2" DataField="Operator2" HeaderText="Op">

                        <ItemTemplate>

                            <asp:Label ID="LblOperator2" runat="server" />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlOperator2" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text=">" Value=">" />

                                <asp:ListItem Text="<" Value="<" />

                                <asp:ListItem Text="=" Value="=" />

                            </asp:DropDownList>

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Value2" DataField="Value2" HeaderText="Val">

                        <ItemTemplate>

                            <asp:Label ID="LblValue2" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:TextBox ID="TxtValue2" runat="server"  />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Join2" DataField="Join1" HeaderText="Join #2">

                        <ItemTemplate>

                            <asp:Label ID="LblJoin2" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlJoin2" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text="AND" Value="AND" />

                                <asp:ListItem Text="OR" Value="OR" />

                            </asp:DropDownList>

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Result3" DataField="Result3" HeaderText="Result #3"

                        SortExpression="Result3">

                        <ItemTemplate>

                            <asp:Label ID="LblResult3" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlResult3" runat="server" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Operator3" DataField="Operator3" HeaderText="Op">

                        <ItemTemplate>

                            <asp:Label ID="LblOperator3" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlOperator3" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text=">" Value=">" />

                                <asp:ListItem Text="<" Value="<" />

                                <asp:ListItem Text="=" Value="=" />

                            </asp:DropDownList>

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Value3" DataField="Value3" HeaderText="Val">

                        <ItemTemplate>

                            <asp:Label ID="LblValue3" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:TextBox ID="TxtValue3" runat="server"  />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Join3" DataField="Join3" HeaderText="Join #3">

                        <ItemTemplate>

                            <asp:Label ID="LblJoin3" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlJoin3" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text="AND" Value="AND" />

                                <asp:ListItem Text="OR" Value="OR" />

                            </asp:DropDownList>

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Result4" DataField="Result4" HeaderText="Result #4"

                        SortExpression="Result4">

                        <ItemTemplate>

                            <asp:Label ID="LblResult4" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlResult4" runat="server" />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Operator4" DataField="Operator4" HeaderText="Op">

                        <ItemTemplate>

                            <asp:Label ID="LblOperator4" runat="server"  />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:DropDownList ID="ddlOperator4" runat="server">

                                <asp:ListItem Text="" Value="" />

                                <asp:ListItem Text=">" Value=">" />

                                <asp:ListItem Text="<" Value="<" />

                                <asp:ListItem Text="=" Value="=" />

                            </asp:DropDownList>

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="Value4" DataField="Value4" HeaderText="Val">

                        <ItemTemplate>

                            <asp:Label ID="LblValue4" runat="server" />

                        </ItemTemplate>

                        <EditItemTemplate>

                            <asp:TextBox ID="TxtValue4" runat="server"  />

                        </EditItemTemplate>

                    </telerik:GridTemplateColumn>

                    <telerik:GridTemplateColumn UniqueName="FlagText" HeaderText="Flag Text">

                        <ItemTemplate>

                            <asp:Label ID="LblFlagText" runat="server" />

                        </ItemTemplate>

                    </telerik:GridTemplateColumn>

                           <telerik:GridTemplateColumn HeaderText="Flag Text" Visible="false" >

                        <ItemTemplate>

                             <asp:Label ID="LblSolutionResultId" runat="server" Text='<%# Eval("SolutionResultId") %>' />

                        </ItemTemplate>

                    </telerik:GridTemplateColumn>

                      <telerik:GridBoundColumn HeaderText="Flag Text" Visible="false" DataField="SolutionResultId">

                      </telerik:GridBoundColumn>

                    <telerik:GridButtonColumn CommandName="Delete" UniqueName="BtnDelete" ItemStyle-Width="20px"

                        ConfirmText="Are you sure you wish to delete this result range?" ButtonType="ImageButton"

                        ItemStyle-HorizontalAlign="Center" ImageUrl="~/Images/delete.png">

                    </telerik:GridButtonColumn>

                </Columns>

                <EditFormSettings>

               <EditColumn  InsertText="Add"  CancelText="Cancel">

               </EditColumn>

           </EditFormSettings>

            </MasterTableView>

        </telerik:RadGrid>





Imports Telerik.Web.UI

Imports Common

Partial Public Class MaintainQualityControlResults

    Inherits BasePage

    Private _SolutionResults As New Dictionary(Of String, String)

    Dim solutionResultId As Integer

    Protected Overloads Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then

            'populate listbox

            lstSolutionTypeGroup.DataSource = BusinessLayer.SolutionType.GetSolutionTypeGroupList

            lstSolutionTypeGroup.DataValueField = "SolutionTypeGroupID"

            lstSolutionTypeGroup.DataTextField = "SolutionTypeGroupText"

            lstSolutionTypeGroup.DataBind()

        End If

    End Sub

    Protected Sub rgResultRanges_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)

        'check if a Solution Type Group is selected

        If lstSolutionTypeGroup.SelectedIndex > -1 Then

            Dim ResultRangeList As List(Of DataLayer.uspSolution_GetAvailableSolutionResultsResult) = _

            BusinessLayer.SolutionQualityControl.GetAvailableSolutionResultRanges(lstSolutionTypeGroup.SelectedValue)

            rgResultRanges.DataSource = ResultRangeList

            'if there are records, than populate dropdown list data

            'If ResultRangeList.Count > 0 Then

            _SolutionResults = BusinessLayer.SolutionQualityControl.GetAllSolutionResults()

            'End If

        End If

    End Sub

    Protected Sub rgResultRanges_Update(ByVal sender As Object, ByVal e As GridCommandEventArgs)

        'check if there is a Solution Type Group selected

        If lstSolutionTypeGroup.SelectedIndex > -1 Then

            'check if passed grid validation

            If gridValidate(CType(e.Item, GridEditableItem)) Then

                Try

                    'pull values from grid row

                    Dim editItem As GridEditableItem = CType(e.Item, GridEditableItem)

                    Dim ResultRangeID As Integer = e.Item.OwnerTableView.DataKeyValues(editItem.ItemIndex)("SolutionResultRangeID").ToString()

                    Dim Result1 As String = CType(e.Item.FindControl("ddlResult1"), DropDownList).SelectedValue

                    Dim Operator1 As String = CType(e.Item.FindControl("ddlOperator1"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV1 As TextBox = CType(e.Item.FindControl("TxtValue1"), TextBox)

                    Dim Value1 As Double

                    If txtV1.Text.Length > 0 Then

                        Value1 = CType(txtV1.Text, Double)

                    End If

                    Dim Join1 As String = CType(e.Item.FindControl("ddlJoin1"), DropDownList).SelectedValue

                    If Result1 <> "" Then

                        solutionResultId = 1

                        BusinessLayer.SolutionQualityControl.UpdateResultRange(ResultRangeID, lstSolutionTypeGroup.SelectedValue, solutionResultId, Convert.ToInt32(Result1.ToString()), Operator1, Value1, Join1, False, User.Identity.Name)

                    End If

                    Dim Result2 As String = CType(e.Item.FindControl("ddlResult2"), DropDownList).SelectedValue

                    Dim Operator2 As String = CType(e.Item.FindControl("ddlOperator2"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV2 As TextBox = CType(e.Item.FindControl("TxtValue2"), TextBox)

                    Dim Value2 As Double

                    If txtV2.Text.Length > 0 Then

                        Value2 = CType(txtV2.Text, Double)

                    End If

                    Dim Join2 As String = CType(e.Item.FindControl("ddlJoin2"), DropDownList).SelectedValue

                    If Result2 <> "" Then

                        solutionResultId = 2

                        BusinessLayer.SolutionQualityControl.UpdateResultRange(ResultRangeID, lstSolutionTypeGroup.SelectedValue, solutionResultId, Convert.ToInt32(Result2.ToString()), Operator2, Value2, Join2, False, User.Identity.Name)

                    End If

                    Dim Result3 As String = CType(e.Item.FindControl("ddlResult3"), DropDownList).SelectedValue

                    Dim Operator3 As String = CType(e.Item.FindControl("ddlOperator3"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV3 As TextBox = CType(e.Item.FindControl("TxtValue3"), TextBox)

                    Dim Value3 As Double

                    If txtV3.Text.Length > 0 Then

                        Value3 = CType(txtV3.Text, Double)

                    End If

                    Dim Join3 As String = CType(e.Item.FindControl("ddlJoin3"), DropDownList).SelectedValue

                    If Result3 <> "" Then

                        solutionResultId = 3

                        BusinessLayer.SolutionQualityControl.UpdateResultRange(ResultRangeID, lstSolutionTypeGroup.SelectedValue, solutionResultId, Convert.ToInt32(Result3.ToString()), Operator3, Value3, Join3, False, User.Identity.Name)

                    End If

                    Dim Result4 As String = CType(e.Item.FindControl("ddlResult4"), DropDownList).SelectedValue

                    Dim Operator4 As String = CType(e.Item.FindControl("ddlOperator4"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV4 As TextBox = CType(e.Item.FindControl("TxtValue4"), TextBox)

                    Dim Value4 As Double

                    If txtV4.Text.Length > 0 Then

                        Value4 = CType(txtV4.Text, Double)

                    End If

                    'save changes

                    If Result4 <> "" Then

                        solutionResultId = 4

                        BusinessLayer.SolutionQualityControl.UpdateResultRange(ResultRangeID, lstSolutionTypeGroup.SelectedValue, solutionResultId, Convert.ToInt32(Result4.ToString()), Operator4, Value4, "", False, User.Identity.Name)

                    End If

                Catch ex As Exception

                    Common.ErrorHandling.ProcessError(ex, "An error occurred while attempting to update a result range.", , , )

                End Try

            Else

                e.Canceled = True

            End If

        Else

            DisplayAlert("Please select a solution type before adding a result range.")

        End If

    End Sub

    Protected Sub rgResultRanges_Delete(ByVal sender As Object, ByVal e As GridCommandEventArgs)

        Try

            Dim editItem As GridEditableItem = CType(e.Item, GridEditableItem)

            Dim ResultRangeID As Integer = e.Item.OwnerTableView.DataKeyValues(editItem.ItemIndex)("SolutionResultRangeID").ToString()

            BusinessLayer.SolutionQualityControl.UpdateResultRange(ResultRangeID, 0, 0, 0, String.Empty, 0, String.Empty, True, _

                                                                   User.Identity.Name)

        Catch ex As Exception

            Common.ErrorHandling.ProcessError(ex, "An error occurred while attempting to update a result range.", , , )

        End Try

    End Sub

    Protected Sub rgResultRanges_Insert(ByVal sender As Object, ByVal e As GridCommandEventArgs)

        'check if there is a Solution Type Group selected

        If lstSolutionTypeGroup.SelectedIndex > -1 Then

            'check if passed grid validation

            If gridValidate(CType(e.Item, GridEditableItem)) Then

                Try

                    ' Dim ResultRangeList As List(Of DataLayer.uspSolution_GetMaxSolutionrangeIdResult) = BusinessLayer.SolutionQualityControl.GetMaxRangeId()

                    Dim rangeId As Integer = BusinessLayer.SolutionQualityControl.GeMaxRangeId()

                    Dim editItem As GridEditableItem = CType(e.Item, GridEditableItem)

                    Dim Result1 As String = CType(e.Item.FindControl("ddlResult1"), DropDownList).SelectedValue

                    Dim Operator1 As String = CType(e.Item.FindControl("ddlOperator1"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV1 As TextBox = CType(e.Item.FindControl("TxtValue1"), TextBox)

                    Dim Value1 As Double

                    If txtV1.Text.Length > 0 Then

                        Value1 = CType(txtV1.Text, Double)

                    End If

                    Dim Join1 As String = CType(e.Item.FindControl("ddlJoin1"), DropDownList).SelectedValue

                    If Result1 <> "" Then

                        solutionResultId = 1

                        BusinessLayer.SolutionQualityControl.AddResultRange(lstSolutionTypeGroup.SelectedValue, rangeId, solutionResultId, Convert.ToInt32(Result1.ToString()), Operator1, Value1, Join1, False, User.Identity.Name)

                    End If

                    Dim Result2 As String = CType(e.Item.FindControl("ddlResult2"), DropDownList).SelectedValue

                    Dim Operator2 As String = CType(e.Item.FindControl("ddlOperator2"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV2 As TextBox = CType(e.Item.FindControl("TxtValue2"), TextBox)

                    Dim Value2 As Double

                    If txtV2.Text.Length > 0 Then

                        Value2 = CType(txtV2.Text, Double)

                    End If

                    Dim Join2 As String = CType(e.Item.FindControl("ddlJoin2"), DropDownList).SelectedValue

                    If Result2 <> "" Then

                        solutionResultId = 2

                        BusinessLayer.SolutionQualityControl.AddResultRange(lstSolutionTypeGroup.SelectedValue, rangeId, solutionResultId, Convert.ToInt32(Result2.ToString()), Operator2, Value2, Join2, False, User.Identity.Name)

                    End If

                    Dim Result3 As String = CType(e.Item.FindControl("ddlResult3"), DropDownList).SelectedValue

                    Dim Operator3 As String = CType(e.Item.FindControl("ddlOperator3"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV3 As TextBox = CType(e.Item.FindControl("TxtValue3"), TextBox)

                    Dim Value3 As Double

                    If txtV3.Text.Length > 0 Then

                        Value3 = CType(txtV3.Text, Double)

                    End If

                    Dim Join3 As String = CType(e.Item.FindControl("ddlJoin3"), DropDownList).SelectedValue

                    If Result3 <> "" Then

                        solutionResultId = 3

                        BusinessLayer.SolutionQualityControl.AddResultRange(lstSolutionTypeGroup.SelectedValue, rangeId, solutionResultId, Convert.ToInt32(Result3.ToString()), Operator3, Value3, Join3, False, User.Identity.Name)

                    End If

                    Dim Result4 As String = CType(e.Item.FindControl("ddlResult4"), DropDownList).SelectedValue

                    Dim Operator4 As String = CType(e.Item.FindControl("ddlOperator4"), DropDownList).SelectedValue

                    'check if there is a value

                    Dim txtV4 As TextBox = CType(e.Item.FindControl("TxtValue4"), TextBox)

                    Dim Value4 As Double

                    If txtV4.Text.Length > 0 Then

                        Value4 = CType(txtV4.Text, Double)

                    End If

                    If Result4 <> "" Then

                        solutionResultId = 4

                        BusinessLayer.SolutionQualityControl.AddResultRange(lstSolutionTypeGroup.SelectedValue, rangeId, solutionResultId, Convert.ToInt32(Result4.ToString()), Operator4, Value4, "", False, User.Identity.Name)

                    End If

                    'BusinessLayer.SolutionQualityControl.AddResultRange(lstSolutionTypeGroup.SelectedValue, Result1, Operator1, Value1, Join1, Result2, Operator2, _

                    '                                                    Value2, Join2, Result3, Operator3, Value3, Join3, Result4, Operator4, Value4, False, _

                    '                                                    User.Identity.Name)

                Catch ex As Exception

                    Common.ErrorHandling.ProcessError(ex, "An error occurred while attempting to add a result range.", , , )

                End Try

            Else

                e.Canceled = True

            End If

        Else

            DisplayAlert("Please select a solution type before adding a result range.")

        End If

    End Sub

    Protected Sub rgResultRanges_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)

        Dim dropList As DropDownList = Nothing

        Dim row As GridItem = e.Item

        Dim rowLabel As Label = Nothing

        Dim R1 As String

        Dim O1 As String

        Dim V1 As String

        Dim J1 As String

        Dim R2 As String

        Dim O2 As String

        Dim V2 As String

        Dim J2 As String

        Dim R3 As String

        Dim O3 As String

        Dim V3 As String

        Dim J3 As String

        Dim R4 As String

        Dim O4 As String

        Dim V4 As String

         If e.Item.ItemType = GridItemType.Item Then

        'Dim solutionId As String = CType(row.FindControl("LblSolutionResultId"), Label).Text

 'Dim  solutionId As String = e.Item.Cells(17).Text.ToString().Trim()

        Dim solutionId As Integer = CType(CType(row.FindControl("LblSolutionResultId"), Label).Text, Integer)

        If solutionId = 1 Then

            R1 = CType(row.FindControl("LblResult1"), Label).Text

            O1 = CType(row.FindControl("LblOperator1"), Label).Text

            V1 = CType(row.FindControl("LblValue1"), Label).Text

            J1 = CType(row.FindControl("LblJoin1"), Label).Text

        Else

            CType(row.FindControl("LblResult1"), Label).Text = ""

            CType(row.FindControl("LblOperator1"), Label).Text = ""

            CType(row.FindControl("LblValue1"), Label).Text = ""

            CType(row.FindControl("LblJoin1"), Label).Text = ""

        End If

        If solutionId = 2 Then

            R2 = CType(row.FindControl("LblResult2"), Label).Text

            O2 = CType(row.FindControl("LblOperator2"), Label).Text

            V2 = CType(row.FindControl("LblValue2"), Label).Text

            J2 = CType(row.FindControl("LblJoin2"), Label).Text

        Else

            CType(row.FindControl("LblResult2"), Label).Text = ""

            CType(row.FindControl("LblOperator2"), Label).Text = ""

            CType(row.FindControl("LblValue2"), Label).Text = ""

            CType(row.FindControl("LblJoin2"), Label).Text = ""

        End If

        If solutionId = 3 Then

            R3 = CType(row.FindControl("LblResult3"), Label).Text

            O3 = CType(row.FindControl("LblOperator3"), Label).Text

            V3 = CType(row.FindControl("LblValue3"), Label).Text

            J3 = CType(row.FindControl("LblJoin3"), Label).Text

        Else

            CType(row.FindControl("LblResult3"), Label).Text = ""

            CType(row.FindControl("LblOperator3"), Label).Text = ""

            CType(row.FindControl("LblValue3"), Label).Text = ""

            CType(row.FindControl("LblJoin3"), Label).Text = ""

        End If

If solutionId = 4 Then

            R4 = CType(row.FindControl("LblResult4"), Label).Text

            O4 = CType(row.FindControl("LblOperator4"), Label).Text

            V4 = CType(row.FindControl("LblValue4"), Label).Text

           

        Else

            CType(row.FindControl("LblResult4"), Label).Text = ""

            CType(row.FindControl("LblOperator4"), Label).Text = ""

            CType(row.FindControl("LblValue4"), Label).Text = ""

          

        End If

        'check if in read-only mode

        If e.Item.ItemType = GridItemType.Item Then

            rowLabel = row.FindControl("lblFlagText")

            'dynamically populate Flag Text

            If Not rowLabel Is Nothing Then

                Dim FlagText As String = ""

             

                'check if there is a first set of values

                If R1.Length > 0 Then

                    FlagText = R1 + " " + O1 + " " + V1 + " "

                    'check if there is a second set of values

                    If J1.Length > 0 Then

                        FlagText = FlagText + J1 + " " + R2 + " " + O2 + " " + V2 + " "

                        'check if there is a third set of values

                        If J2<> "" Then

                            FlagText = FlagText + J2 + " " + R3 + " " + O3 + " " + V3 + " "

                            'check if there is a fourth set of values

                            If J3 <> "" then

                                FlagText = FlagText + J3 + " " + R4 + " " + O4 + " " + V4 + " "

                            End If

                        End If

                    End If

                End If

                rowLabel.Text = FlagText

            End If

        End If

End If

        If (e.Item.ItemType = GridItemType.EditFormItem And e.Item.IsInEditMode And (Not e.Item.OwnerTableView.IsItemInserted)) Then

            Dim item As GridEditableItem = CType(e.Item, GridEditableItem)

            Dim dataitem As DataLayer.uspSolution_GetAvailableSolutionResultsResult = CType(e.Item.DataItem, DataLayer.uspSolution_GetAvailableSolutionResultsResult)

            dropList = row.FindControl("ddlResult1")

            If Not dropList Is Nothing Then

                If dataitem.SolutionResultId = 1 Then

                    Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, dataitem.Resultid)

                    If dataitem.Operator <> String.Empty Then

                        dropList = row.FindControl("ddlOperator1")

                        dropList.SelectedValue = dataitem.Operator

                    End If

                    'check if there is a value

                    If dataitem.Join1 <> String.Empty Then

                        dropList = row.FindControl("ddlJoin1")

                        dropList.SelectedValue = dataitem.Join1

                    End If

                End If

            Else

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            'check if there is a value

            dropList = row.FindControl("ddlResult2")

            If Not dropList Is Nothing Then

                If dataitem.SolutionResultId = 2 Then

                    Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, dataitem.Resultid)

                    If Not dataitem.Operator Is Nothing Then

                        If dataitem.Operator <> String.Empty Then

                            dropList = row.FindControl("ddlOperator2")

                            dropList.SelectedValue = dataitem.Operator

                        End If

                    End If

                    'check if there is a value

                    If Not dataitem.Join1 Is Nothing Then

                        If dataitem.Join1 <> String.Empty Then

                            dropList = row.FindControl("ddlJoin2")

                            dropList.SelectedValue = dataitem.Join1

                        End If

                    End If

                End If

            Else

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            'check if there is a value

          

            dropList = row.FindControl("ddlResult3")

            If Not dropList Is Nothing Then

                If dataitem.SolutionResultId = 3 Then

                    Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, dataitem.Resultid)

                    If Not dataitem.Operator Is Nothing Then

                        If dataitem.Operator <> String.Empty Then

                            dropList = row.FindControl("ddlOperator3")

                            dropList.SelectedValue = dataitem.Operator

                        End If

                    End If

                    'check if there is a value

                    If Not dataitem.Join1 Is Nothing Then

                        If dataitem.Join1 <> String.Empty Then

                            dropList = row.FindControl("ddlJoin3")

                            dropList.SelectedValue = dataitem.Join1

                        End If

                    End If

                End If

            Else

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            'check if there is a value

            dropList = row.FindControl("ddlResult4")

            If Not dropList Is Nothing Then

                If dataitem.SolutionResultId = 4 Then

                    Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, dataitem.Resultid)

                    If Not dataitem.Operator Is Nothing Then

                        If dataitem.Operator <> String.Empty Then

                            dropList = row.FindControl("ddlOperator4")

                            dropList.SelectedValue = dataitem.Operator

                        End If

                    End If

                End If

            Else

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            'check if there is a value

        ElseIf e.Item.OwnerTableView.IsItemInserted Then 'in add new mode

            dropList = row.FindControl("ddlResult1")

            If Not dropList Is Nothing Then

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            dropList = row.FindControl("ddlResult2")

            If Not dropList Is Nothing Then

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            dropList = row.FindControl("ddlResult3")

            If Not dropList Is Nothing Then

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

            dropList = row.FindControl("ddlResult4")

            If Not dropList Is Nothing Then

                Helper.BindDropDownList(dropList, _SolutionResults, String.Empty, String.Empty)

            End If

        End If

    End Sub

   

End Class

Shinu
Top achievements
Rank 2
 answered on 09 Sep 2010
1 answer
86 views
Hi,
i spent some time to see why this bug happens and i put together a small example. Perhaps you should do something about it.
I atttached a snapshot of a simple textbox that breaks to the 100% width of the container it resides on if you hapen to use "table { width:100% }" inside a css file.

Here is the code:

 

<head runat="server">
    <title></title>
    <style type="text/css">
        table { width:100%; }
    </style>    
    <style type="text/css">
        *html .rfdDecorated, 
        *html a.rfdSkinnedButton,
        {
            vertical-align: top !important;
        }
        *+html .rfdDecorated, 
        *+html a.rfdSkinnedButton
            
        {
            vertical-align: top !important;
        }
    </style>
</head>
<body style="background-color:#fff;">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="All" />
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="false" Skin="Black" PersistenceMode="Cookie">
        </telerik:RadSkinManager>
        <table style="width:100%; height:200px;" border="1">
            <tr>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server" style="width:200px;" />                
                </td>
            </tr>
        </table>
    </form>
</body>
</html>

 

Thank you.

 

 

 

 

 

Fiko
Telerik team
 answered on 09 Sep 2010
1 answer
107 views
i need an example of date filter which can accept a range (start and end dates), and export the filtered results to excel
thanks in advance
Daniel
Telerik team
 answered on 09 Sep 2010
3 answers
84 views
Hi
    I have LinkButton in radWindow . In Firefox the click event of button doesn't get fired & not even postback. In IE it works fine &  for normal window too. If anyone knows the solution, it would be of great help.

Warm Regards
Fiko
Telerik team
 answered on 09 Sep 2010
2 answers
161 views
Hi,

I'm using RadControls for ASP.NET AJAX Q2 2010 in my 3.5 web app. 

My goal is to implement drag & drop from the RadListView to the RadEditor, and so I've copied from the ListView Demo. My code seems to work find, I can click on the DragHandle and drag the item around the page, but as soon as I hover over the RadEditor the dragging becomes erratic, and releasing the button has no effect.

If I drag and drop to any other element on the page the sample code works fine. Here's my aspx page:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="edittest.aspx.vb" Inherits="TripReports_edittest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="scriptman" runat="server" />
        <h1>
            Media Gallery</h1>
        <p>
            You can use all of these images in your report.</p>
        <telerik:RadListView ID="rlvItems" runat="server" DataKeyNames="FileURL" ClientDataKeyNames="FileURL,SourceURL">
            <ClientSettings AllowItemsDragDrop="true">
                <ClientEvents OnItemDragStarted="itemDragStarted" OnItemDropping="trackDropping" />
            </ClientSettings>
            <ItemTemplate>
                <div class="rlvI">
                    <telerik:RadListViewItemDragHandle ID="RadListViewItemDragHandle1" runat="server"
                        ToolTip="Drag to organize" />
                    <asp:Image ID="image" runat="server" />
                </div>
            </ItemTemplate>
        </telerik:RadListView>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">
                var originalMsg = "";

                function itemDragStarted(sender, args)
                {
                }

                function itemDragging(sender, args)
                {
                }

                function showAction(title)
                {
                }

                function trackDropping(sender, args)
                {
                }
            </script>

        </telerik:RadCodeBlock>
        <div id="radEditor">
            <telerik:RadEditor SkinID="BasicSetOfTools" Width="700" Height="500" ID="RadEditor1"
                runat="server">
                <Content>
                </Content>
            </telerik:RadEditor>
        </div>
    </div>
    </form>
</body>
</html>

Has anyone successfully done this?
Nikolay Rusev
Telerik team
 answered on 09 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?