Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
146 views
Hello All,

I am recently working on a problem where i need to create an area for customer to entering employees information, to start off there will be no information contained within the table. Then using the setup down below and some back end C# i want to populate the GridEditForm that also doesn't want to popup. I have been looking for some information on how to program in the back end or possibly java script, though i don't see this as a client side issue. this as i wish i could use an sql data source but to limit access and security we use web services where i get information in a data set which i want to manipulate then send it only once it has been completed.

There's pretty much no C# back end as of now, just a garbled mess of failed tests

ASP
<telerik:RadGrid ID="grdEmployee" GridLines="Horizontal" runat="server" AllowAutomaticDeletes="True"
                        AllowAutomaticInserts="True" PageSize="25" AllowAutomaticUpdates="True" AllowPaging="True"
                        AutoGenerateColumns="False" OnItemUpdated="grdEmployee_ItemUpdated" OnItemDeleted="grdEmployee_ItemDeleted"
                        OnItemInserted="grdEmployee_ItemInserted" OnItemCreated="grdEmployee_ItemCreated"
                        OnEditCommand="grdEmployee_OnEdit" OnNeedDataSource="grdEmployee_OnNeedDataSource">
                      
                        <PagerStyle Mode="NextPrevAndNumeric" />
                         
                        <MasterTableView Width="100%" CommandItemDisplay="Top" AutoGenerateColumns="False"
                            ShowHeadersWhenNoRecords="true">
                            <Columns>
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="editColumn">
                                    <ItemStyle CssClass="btnEdit" />
                                </telerik:GridEditCommandColumn>
                                <telerik:GridDropDownColumn DataField="Employee" HeaderText="Employee" ListTextField="listEmployeeName"
                                    ListValueField="EmployeeName" UniqueName="EmployeeName" ColumnEditorID="grdEmployeeDDLEditor">
                                </telerik:GridDropDownColumn>
                                <telerik:GridMaskedColumn HeaderText="Last 4 SSN" Mask="####" AllowSorting="false"
                                    UniqueName="DetailSSN" ColumnEditorID="">
                                </telerik:GridMaskedColumn>
                                <telerik:GridDropDownColumn DataField="CraftDescription" HeaderText="Craft" ListTextField="listEmployeeCraft"
                                    ListValueField="EmployeeCraft" UniqueName="EmployeeCraft" ColumnEditorID="grdEmployeeDDLEditor">
                                </telerik:GridDropDownColumn>
                                <telerik:GridDropDownColumn DataField="JobClassDescription" HeaderText="Job Level"
                                    ListTextField="listEmployeeLevel" ListValueField="EmployeeLevel" UniqueName="EmployeeLevel"
                                    ColumnEditorID="grdEmployeeDDLEditor" EditFormColumnIndex="1">
                                </telerik:GridDropDownColumn>
                                <telerik:GridNumericColumn DataField="HoursWorked" HeaderText="Hours Worked" UniqueName="EmployeeHoursWorked"
                                    NumericType="Number" AllowRounding="false" DecimalDigits="2" ColumnEditorID="grdEmployeeNumericColoumnEditor"
                                    EditFormColumnIndex="1">
                                </telerik:GridNumericColumn>
                                <telerik:GridNumericColumn DataField="RateOfPay" HeaderText="Rate of Pay with Benefits"
                                    UniqueName="EmployeeRateOfPay" NumericType="Currency" AllowRounding="false" DecimalDigits="2"
                                    ColumnEditorID="grdEmployeeNumericColoumnEditor" EditFormColumnIndex="1">
                                </telerik:GridNumericColumn>
                                <telerik:GridButtonColumn ConfirmText="Delete this Payroll Entry?" ConfirmDialogType="RadWindow"
                                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                    UniqueName="DeleteColumn">
                                    <ItemStyle HorizontalAlign="Center" CssClass="btnEdit" />
                                </telerik:GridButtonColumn>
                            </Columns>
                            <CommandItemSettings ShowRefreshButton="false"  />
                            <EditFormSettings ColumnNumber="2" CaptionDataField="EmployeeName" CaptionFormatString="Edit Payroll Entry for {0}"
                                InsertCaption="New Payroll Entry">
                                <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                                <FormCaptionStyle CssClass="grdEditForm"></FormCaptionStyle>
                                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                                    Width="100%" />
                                <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                                <EditColumn ButtonType="ImageButton" InsertText="Add Entry" UpdateText="Update Entry"
                                    UniqueName="EditCommandColumn1" CancelText="Cancel Edit">
                                </EditColumn>
                                <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnRowDblClick="grdEmployee_RowDblClick" />
                        </ClientSettings>
                    </telerik:RadGrid>
                    <telerik:GridDropDownListColumnEditor ID="grdEmployeeDDLEditor" runat="server" DropDownStyle-Width="110px" />
                    <telerik:GridNumericColumnEditor ID="grdEmployeeNumericColoumnEditor" runat="server"
                        NumericTextBox-Width="125px" />
                    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    </telerik:RadWindowManager>

And for posterity a brief snippet of C# of my data set

C#
protected void createDummyRow()
    {
        employeeDummyRow = new DataSet();
        DataTable dummyTable = employeeDummyRow.Tables.Add();
 
        dummyTable.Columns.Add("Employee", typeof(String));
        dummyTable.Columns.Add("CraftDescription", typeof(String));
        dummyTable.Columns.Add("JobClassDescription", typeof(String));
        dummyTable.Columns.Add("HoursWorked", typeof(Decimal));
        dummyTable.Columns.Add("RateOfPay", typeof(Decimal));
 
        dummyTable.Rows.Add("","","",1,1);
    }
 
    protected void Page_UnLoad(object sender, EventArgs e)
    {
        if (dsEmployees == null)
        {
            Session["dsEmployees"] = grdEmployee.DataSource;
        }
        else
        {
            Session["dsEmployees"] = dsLEAPEmployees;
        }
 
    }
 
    public void grdEmployee_OnNeedDataSource(Object sender, EventArgs e)
    {
        if (grdEmployee.DataSourceIsAssigned == true)
        {
            grdEmployee.DataSource = grdEmployee.DataSource;
        }
        else
        {
            grdEmployee.DataSource = employeeDummyRow.Tables[0].DefaultView;
        }
         
    }

I hope someone can suggest possibly a mind blowingly easy way to merge data set and caching of the data with the current structure!

Thanks!

David
Daniel
Telerik team
 answered on 12 Jun 2012
1 answer
124 views
hi
i am completely stuck at a point while scheduling an appointment b/w doctor and a patient.
i want to know what does timeslotcreated eventArgs e mean in timeslot created event .
I have written my code as follows :

if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-06 08:30:00.000")) == 0 && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-06 08:45:00.000")) == 0)
{
e.TimeSlot.CssClass = "rsCategoryGreen";
}
if (DateTime.Compare(e.TimeSlot.Start, Convert.ToDateTime("2012-06-06 08:45:00.000")) == 0 && DateTime.Compare(e.TimeSlot.End, Convert.ToDateTime("2012-06-06 09:00:00.000")) == 0)
{
e.TimeSlot.CssClass = "rsCategoryGreen";
}

The whole slot of 08:30 - 09:00 is getting green. and when i remove upper IF then nothing happens in output.
please solve it or give an alternate solution to do this?





Still i am waiting for someone's reply. I want to clear my problem now..
I have an appointment of 2 hours and i want to customize it in different timespan like one of half an hour and second of one and half hour with different custom. So which event schould i use?
Reply soon
Ivana
Telerik team
 answered on 12 Jun 2012
3 answers
114 views
I have a chart with line series. It happens that the series starting with the same values​​, or close to, the labels are mixed not giving to differentiate from one another. How do I space the value labels of the series?
Paulo
Top achievements
Rank 1
 answered on 12 Jun 2012
3 answers
197 views
Hello,

I've looked in the forums, but I could not find the answer for my particular problem.

I am in the process of creating two TreeViews on my page.  The first one is a directory listing of ASPX pages within my website which I've gotten working already.  When the user clicks on the name of an ASPX page a second tree view will be populated containing the IDs of the controls contained within that page.  I put those IDs in a collection (ArrayList).  The second treeview's datasource is then set to the collection I've created which then gets displayed on the screen.  Up to this point I've gotten things to work.

Here's my issue:  I'm trying to dynamically create context menus for each node within the second treeview depending on what kind of control is selected (i.e. button, textbox, listbox, etc...).

I would really appreciate it if anyone can show me an example of how this can be done.
Shawn
Top achievements
Rank 1
 answered on 12 Jun 2012
0 answers
103 views
javascript:

    
function RadGrid1_Command(sender, args)
 {
           args.set_cancel(
true);
            debugger;
            
var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();
            
var pageSize = sender.get_masterTableView().get_pageSize();
....................................................................
............................................................
......................................................................
..............................................................
}
function updateGrid(result) {
 
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
            tableView.set_dataSource(result);
            tableView.dataBind();
        }
       
function updateVirtualItemCount(result)
{
          
var tableView = $find(document.getElementById("hdnradgridclientid").value).get_masterTableView();
          tableView.set_virtualItemCount(result);
        }       
 

<
telerik:RadGrid ID="RadGridAssessment" EnableViewState="false" Width="100%" runat="server" 
        AllowSorting="True" Height="430px" AllowMultiRowSelection="true" AllowPaging="true"
     GridLines="None" BorderWidth="0" AutoGenerateColumns="true" PagerStyle-AlwaysVisible="false"
     Skin="Vista" OnNeedDataSource="RadGrid1_NeedDataSource">
                <PagerStyle Visible="false" />
               <MasterTableView Width="99%">
                  </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
               <ClientEvents OnCommand="RadGrid1_Command" />
               <Selecting AllowRowSelect="True"></Selecting>
              <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true"
                 ScrollHeight="275px" SaveScrollPosition="True"></Scrolling>
                     </ClientSettings>
 </telerik:RadGrid>
the above codings are using in my code....and in my pageload i set  
RadGridAssessment.PageSize = 5;
the problem is.if the grid contains 6 to 9 rows means...i am unable to view second page..but if above ten means its working fine...
and i set RadGridAssessment.PageSize = 10; ..at the time if grid contains 11 to 20 records..i am unable to view second page...
please help me 
Prab
Top achievements
Rank 1
 asked on 12 Jun 2012
3 answers
109 views
Hi,

I have an application that uses a Treeview control.
I have now added a RadCombo to the page using the following html:
<div style="position: absolute; top: 230px; left: 300px; width: 100px; height: 30px">
  <telerik:RadComboBox ID="PalletList" runat="server" Width="100px"
    Enabled="False" EnableEmbeddedSkins="False" EnableTextSelection="False"
    Skin="XLogixBlue" SkinID="XLogixBlue" ZIndex="8000">
  </telerik:RadComboBox>
</div>

This block of code appears before the treeview in the page.
When this code is inserted in the page, the formatting in the treeview is completely messed up, and it no longer works.
e.g. initially the treeview displays only the top level node(s). When the combo is in the page, the pus sign to the left of the node does not display, but instead shows a little circle, and the node can not be expanded.
Please see attached images.

I am using Combos in several other pages, but so far this is the only one with a treeview.

I am using RadControls version 2012_1_215

Any suggestion appreciated.

Thank you

Paul
Paul
Top achievements
Rank 1
 answered on 12 Jun 2012
2 answers
107 views
I have a problem with radconfirm control.

Scenario: master/Page

If I use resources does not work, but If I hardcode the title and text works perfectly:
(Resources exists, and fill variables ok.)
      

It is my code:

   if(Master.Organization.CommunityHasUser(GetId()))
                {
                    textMessage = _resources.GetString("DeleteCommunityWithUserText",
                                                       new CultureInfo(Master.Culture)).Replace("{0}",
                                                                                                Session["Name"].ToString
                                                                                                    ());
                }else
                {
                    textMessage = _resources.GetString("DeleteCommunityText", new CultureInfo(Master.Culture)).Replace("{0}", Session["Name"].ToString());
                }
              


                string titleMessage = _resources.GetString("DeleteCommunityTitle", new CultureInfo(Master.Culture)).Replace("{0}", Session["Name"].ToString());


                RadWindowManager1.RadConfirm(textMessage,"confirmCallBackFn", 330,100, null,titleMessage);

does not show radconfirm


but if I do this:

string  textMessage  ="Test";
string titleMessage  ="Message";

     RadWindowManager1.RadConfirm(textMessage,"confirmCallBackFn", 330,100, null,titleMessage); 

Show the radconfirm and works perfectly.

Please I need help!!!



July
Top achievements
Rank 2
 answered on 12 Jun 2012
1 answer
89 views
hi all

I have a hierachical rad grid in my page
this grid has up to 3 level and each row has a template field that contains rad numeric text box for "grade" and 1 column for "max grade"

user must enter grade for each child in last level. then in client side, I must check that grade:
1)this grade can't upper than max_grade
2)sum of grade of childes must be calculate for grade of their parent

this is my grid:
<telerik:RadGrid ID="gv_cheque_list" runat="server" GridLines="None" Width="100%"
                    AllowSorting="True" AutoGenerateColumns="False" ShowFooter="True" OnDetailTableDataBind="gv_cheque_list_DetailTableDataBind"
                    OnItemCommand="gv_cheque_list_ItemCommand" Skin="Web20" OnItemDataBound="gv_cheque_list_ItemDataBound">
                    <AlternatingItemStyle BackColor="#a7bcdb" />
                    <MasterTableView AllowSorting="True" DataKeyNames="assessment_parameter_id" Dir="RTL"
                        Font-Names="Tahoma" HeaderStyle-HorizontalAlign="Center" HorizontalAlign="Center"
                        HierarchyLoadMode="Client" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#99CCFF" >
                        <AlternatingItemStyle BackColor="#a7bcdb" />
                        <DetailTables>
                            <telerik:GridTableView runat="server" Name="ChequeList" DataKeyNames="assessment_parameter_id"
                                Font-Names="Tahoma" HierarchyLoadMode="Client" Dir="RTL" NoDetailRecordsText="it hasn't child" >
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="parent_id" MasterKeyField="assessment_parameter_id" />
                                </ParentTableRelation>
                                <AlternatingItemStyle BackColor="#a7bcdb" />
                                <HeaderStyle HorizontalAlign="Center" CssClass="detailTableLevel1" />
                                <ExpandCollapseColumn>
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridTemplateColumn HeaderText="cheque_list_id" UniqueName="cheque_list_id"
                                        Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_cheque_list_id" runat="server" Text='<%# Bind("cheque_list_id") %>' />
                                        </ItemTemplate>
                                        <HeaderStyle Width="50px" />
                                        <ItemStyle Width="50px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="assessment_parameter_id" UniqueName="assessment_parameter_id"
                                        Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_assessment_parameter_id" runat="server" Text='<%# Bind("assessment_parameter_id") %>' />
                                        </ItemTemplate>
                                        <HeaderStyle Width="50px" />
                                        <ItemStyle Width="50px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="parent_id" UniqueName="parent_id" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_parent_id" runat="server" Text='<%# Bind("parent_id") %>' />
                                        </ItemTemplate>
                                        <HeaderStyle Width="50px" />
                                        <ItemStyle Width="50px" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="child_count" UniqueName="child_count" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_child_count" runat="server" Text='<%# Bind("child_count") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="type" UniqueName="type" Visible="false">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_type" runat="server" Text='<%# Bind("type") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="assessment_parameter_code" EmptyDataText="----"
                                        HeaderText="assessment_parameter_code" Resizable="true" UniqueName="assessment_parameter_code">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="parameter_name" EmptyDataText="----" HeaderText="parameter_name"
                                        Resizable="true" UniqueName="parameter_name">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="max_grade" EmptyDataText="----" HeaderText="max_grade"
                                        Resizable="true" UniqueName="max_grade">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="grade" UniqueName="grade">
                                        <ItemTemplate>
                                            <telerik:RadNumericTextBox ID="txt_grade" runat="server" Text='<%# Bind("grade") %>'>
                                               <ClientEvents OnValueChanged="txt_grade_value_changed" />
                                            </telerik:RadNumericTextBox>
                                            <asp:HiddenField ID="hd_type" runat="server" Value='<%# Bind("type") %>' />
                                            <asp:HiddenField ID="hd_parent_id" runat="server" Value='<%# Bind("parent_id") %>' />
                                            <asp:HiddenField ID="hd_ass_id" runat="server" Value='<%# Bind("assessment_parameter_id") %>' />
                                            <asp:HiddenField ID="hd_child_count" runat="server" Value='<%# Bind("child_count") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <DetailTables>
                                    <telerik:GridTableView runat="server" Name="ChequeListDetail" Dir="RTL"  DataKeyNames="assessment_parameter_id"
                                        HierarchyLoadMode="Client" NoDetailRecordsText="it hasn't child"
                                        Font-Names="Tahoma">
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="parent_id" MasterKeyField="assessment_parameter_id" />
                                        </ParentTableRelation>
                                        <HeaderStyle HorizontalAlign="Center" CssClass="detailTableLevel2" />
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderText="cheque_list_id" UniqueName="cheque_list_id"
                                                Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_cheque_list_id" runat="server" Text='<%# Bind("cheque_list_id") %>' />
                                                </ItemTemplate>
                                                <HeaderStyle Width="50px" />
                                                <ItemStyle Width="50px" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="assessment_parameter_id" UniqueName="assessment_parameter_id"
                                                Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_assessment_parameter_id" runat="server" Text='<%# Bind("assessment_parameter_id") %>' />
                                                </ItemTemplate>
                                                <HeaderStyle Width="50px" />
                                                <ItemStyle Width="50px" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="parent_id" UniqueName="parent_id" Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_parent_id" runat="server" Text='<%# Bind("parent_id") %>' />
                                                </ItemTemplate>
                                                <HeaderStyle Width="50px" />
                                                <ItemStyle Width="50px" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="child_count" UniqueName="child_count" Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_child_count" runat="server" Text='<%# Bind("child_count") %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="type" UniqueName="type" Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbl_type" runat="server" Text='<%# Bind("type") %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="assessment_parameter_code" EmptyDataText="----"
                                                HeaderText="assessment_parameter_code" Resizable="true" UniqueName="assessment_parameter_code">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="parameter_name" EmptyDataText="----" HeaderText="parameter_name"
                                                Resizable="true" UniqueName="parameter_name">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="max_grade" EmptyDataText="----" HeaderText="max_grade"
                                                Resizable="true" UniqueName="max_grade">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn HeaderText="grade" UniqueName="grade">
                                                <ItemTemplate>
                                                    <telerik:RadNumericTextBox ID="txt_grade" runat="server" Text='<%# Bind("grade") %>'>
                                                       <ClientEvents OnValueChanged="txt_grade_value_changed" />
                                                    </telerik:RadNumericTextBox>
                                                    <asp:HiddenField ID="hd_type" runat="server" Value='<%# Bind("type") %>' />
                                                    <asp:HiddenField ID="hd_parent_id" runat="server" Value='<%# Bind("parent_id") %>' />
                                                    <asp:HiddenField ID="hd_ass_id" runat="server" Value='<%# Bind("assessment_parameter_id") %>' />
                                                    <asp:HiddenField ID="hd_child_count" runat="server" Value='<%# Bind("child_count") %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </telerik:GridTableView>
                                </DetailTables>
                            </telerik:GridTableView>
                        </DetailTables>
                        <NoRecordsTemplate>
                             
                        </NoRecordsTemplate>
                        <CommandItemSettings ShowAddNewRecordButton="false" />
                        <ExpandCollapseColumn Visible="True" ExpandImageUrl="Images/plus.png" CollapseImageUrl="Images/minus.png"
                            ButtonType="ImageButton">
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="cheque_list_id" UniqueName="cheque_list_id"
                                Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbl_cheque_list_id" runat="server" Text='<%# Bind("cheque_list_id") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="parent_id" UniqueName="parent_id" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbl_parent_id" runat="server" Text='<%# Bind("parent_id") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="child_count" UniqueName="child_count" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbl_child_count" runat="server" Text='<%# Bind("child_count") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="type" UniqueName="type" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbl_type" runat="server" Text='<%# Bind("type") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="assessment_parameter_code" EmptyDataText="----"
                                HeaderText="assessment_parameter_code" Resizable="true" UniqueName="assessment_parameter_code">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="parameter_name" EmptyDataText="----" HeaderText="parameter_name"
                                Resizable="true" UniqueName="parameter_name">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="max_grade" EmptyDataText="----" HeaderText="max_grade"
                                Resizable="true" UniqueName="max_grade">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="grade" UniqueName="grade">
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox ID="txt_grade" runat="server" Text='<%# Bind("grade") %>'>
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                        <Resizing AllowColumnResize="True" ResizeGridOnColumnResize="false" />
                    </ClientSettings>
                </telerik:RadGrid>
 

and in client side i write this function:
<script language="JavaScript1.2" type="text/javascript">
    function txt_grade_value_changed(sender, args) {
        debugger;
        var newValue = args.get_newValue();
        var oldValue = args.get_oldValue();
      //  var d_i = sender.get_parent().get_dataItems();
  
  
        var curr_tr = $('input[id="' + sender._clientID + '"]').closest("tr"); 
        var father_tr = $('input[id="' + sender._clientID + '"]').closest("table").closest("tr").prev();
  
        var father_max_grade = father_tr[0].cells[3].innerText;
  
        if (newValue > curr_max_grade)
            alert('You can continueenter thistory grade');
  
  
  
        var current_grade = 0;
  
        try {
            current_grade = $(curr_tr[0].cells[3].children[0]).closest("span")[0].children[0].value; 
            var parent_id = curr_tr[0].cells[3].children[2].value;
            var curr_id = curr_tr[0].cells[3].children[3].value;
            var curr_max_grade = curr_tr[0].cells[2].innerText;
  
        }
        catch (Error) {
  
            current_grade = $(curr_tr[0].cells[4].children[0]).closest("span")[0].children[0].value;
            var parent_id = curr_tr[0].cells[4].children[2].value;
            var curr_id = curr_tr[0].cells[4].children[3].value;
            var curr_max_grade = curr_tr[0].cells[3].innerText;
  
        }
  
        var father_grade_txt = $(father_tr[0].cells[4].children[0]).closest("span")[0].children[0];
  
        var child_row_array = new Array(10);
        var i = 0;
        var curr_tr2 = curr_tr;
  
        child_row_array[i] = curr_tr;
        i++;
  
        try {
            do {
                if (curr_tr2[0] != undefined && curr_tr2[0].cells[3].children[2].value != undefined && curr_tr2[0].cells[3].children[2].value == parent_id && curr_tr2[0].cells[3].children[3].value != curr_id) {
  
                    child_row_array[i] = curr_tr2;
                    i++;
                }
                curr_tr2 = curr_tr2.next('tr');
  
  
            } while (curr_tr2 && curr_tr2[0] && curr_tr2[0].cells[3].children[2].value != undefined && curr_tr2[0].cells[3].children[3].value != curr_id)
  
            curr_tr2 = curr_tr;
  
            do {
                if (curr_tr2[0] != undefined && curr_tr2[0].cells[3].children[2].value != undefined && curr_tr2[0].cells[3].children[2].value == parent_id && curr_tr2[0].cells[3].children[3].value != curr_id) {
  
                    child_row_array[i] = curr_tr2;
                    i++;
                }
                curr_tr2 = curr_tr2.prev('tr');
  
            } while (curr_tr2 && curr_tr2[0] && curr_tr2[0].cells[3].children[2].value != undefined && curr_tr2[0].cells[3].children[3].value != curr_id)
        }
        catch (Error) {
            try {
                do {
  
                    if (curr_tr2[0] != undefined && curr_tr2[0].cells[4].children[2].value != undefined && curr_tr2[0].cells[4].children[2].value == parent_id && curr_tr2[0].cells[4].children[3].value != curr_id) {
  
                        child_row_array[i] = curr_tr2;
                        i++;
                    }
                    curr_tr2 = curr_tr2.next('tr');
  
  
                } while (curr_tr2 && curr_tr2[0] && curr_tr2[0].cells[4].children[2].value != undefined && curr_tr2[0].cells[4].children[3].value != curr_id)
            }
            catch (Error) {
            }
  
            curr_tr2 = curr_tr;
            try {
                do {
                    if (curr_tr2[0] != undefined && curr_tr2[0].cells[4].children[2].value != undefined && curr_tr2[0].cells[4].children[2].value == parent_id && curr_tr2[0].cells[4].children[3].value != curr_id) {
  
                        child_row_array[i] = curr_tr2;
                        i++;
                    }
                    curr_tr2 = curr_tr2.prev('tr');
  
                } while (curr_tr2 && curr_tr2[0] && curr_tr2[0].cells[4].children[2].value != undefined && curr_tr2[0].cells[4].children[3].value != curr_id)
            }
            catch (Error) {
            }
        }
        var array_lenght = i;
        var count = 0;
        var sum = 0.00;
    
        for (var i = 0; i < array_lenght; i++) {
            try {
                if (child_row_array[i][0].cells[3].firstChild.childNodes[0].value != "")
                    sum = sum + parseFloat(child_row_array[i][0].cells[3].firstChild.childNodes[0].value);
            }
            catch (Error) {
                if (child_row_array[i][0].cells[4].firstChild.childNodes[0].value != "")
                    sum = sum + parseFloat(child_row_array[i][0].cells[4].firstChild.childNodes[0].value);
            }
        }
  
        father_grade_txt.value = sum;
  
  
  
    }
  
</script>


but it has error on finde brothers row.

how can I do that easily?
how can I find brothers of a row and calculate sum of their grade?

Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Jun 2012
1 answer
200 views
I have an application scenario where the user is allowed to pick more than one item from more than one category of items.  I've solved this by creating a RadListView that will be bound to the categories and then using an ItemTemplate in the ListView to create a RadListBox for each category that will allow the user to select options in each category.  Everything was working great until one of the categories ended up having over 10,000 possible options to choose from.  I decided to try to solve this problem by setting EnableLoadOnDemand to true on the RadListBox in the ItemTemplate so it wouldn't try to render every item for every category to the page when it first loaded.  However, this doesn't work at all.  If I try to bind the ListView on Page Load, I get a weird error.  If I bind the ListView later (on a button click) I get blank RadListBoxes.  I've linked to a sample web project to show you what I'm trying to do.  Is this even possible?

http://www.iconstudios.org/RadListBoxinTemplate.zip

If I can't use EnableLoadOnDemand to accomplish this, what other strategies do you recommend for selecting from a huge list?

Thanks,

Patrick
Peter Filipov
Telerik team
 answered on 12 Jun 2012
0 answers
81 views
Hi,
i want to edit uploaded files such as MS.Excel and Ms.Word and note in my webpage 
(without download and again upload it).
is there a special tool for this topic?
please help me.
thanks,
Azadeh
Azadeh
Top achievements
Rank 1
 asked on 12 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?