Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
220 views
This is my scenario I have a grid that within one column I added a second grid So far i have populated both of them and the editing in place is working awesome for both grids when performing Insert and Delete actions.

This is my Code (aspx file)

<telerik:RadGrid runat="server" ID="gv_EmployeesObjectives" Width="100%" Font-Names="Arial" Font-Size="12px" Skin="Office2007"
                        AutoGenerateColumns="false"
                        OnItemCreated="gv_EmployeesObjectives_ItemCreated" OnItemDataBound="gv_EmployeesObjectives_ItemDataBound"
                    >
                        <MasterTableView Name="gv_Objectives" DataKeyNames="ID">
                            <Columns>
                                <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit" HeaderStyle-Width="90px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridEditCommandColumn>
                                <telerik:GridTemplateColumn HeaderStyle-Width="150px">
                                    <HeaderTemplate><asp:Label runat="server" ID="lbl_01" Text="Copy Data from Week"></asp:Label></HeaderTemplate>
                                    <ItemTemplate>
                                        <telerik:RadComboBox ID="copyDataDDL" runat="server" AutoPostBack="true" Height="100px" OnSelectedIndexChanged="copyDataDDL_SelectdIndexChanged"></telerik:RadComboBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn UniqueName="FY" SortExpression="FY" HeaderText="FY" HeaderButtonType="TextButton" DataField="FY"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="FiscalWeek" DataField="FiscalWeek" HeaderText="Week"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjStopBys" DataField="ObjStopBys" HeaderText="# of Stop Bys" Visible="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjStopByContacts" DataField="ObjStopByContacts" HeaderText="# of Contacts from Stop Bys" Visible="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjAppels" DataField="ObjAppels" HeaderText="# of<br />Calls"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjContacts" DataField="ObjContacts" HeaderText="# of<br />Contacts"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="Objr_v" DataField="Objr_v" HeaderText="# of<br />Appts."></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjPres" DataField="ObjPres" HeaderText="# of<br />Pres."></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjVentes" DataField="ObjVentes" HeaderText="# of Contracts" Visible="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ObjRVSP" DataField="ObjRVSP" HeaderText="ANW"></telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn UniqueName="ProductsList">
                                    <HeaderTemplate></HeaderTemplate>
                                    <ItemTemplate>
                                        <telerik:RadGrid runat="server" ID="gv_ProductsList" AutoGenerateColumns="false" Skin="Office2007" ShowHeader="false"
                                            AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                                            OnNeedDataSource="gv_ProductsList_NeedDataSource" OnItemCommand="gv_ProductsList_ItemCommand"
                                            OnItemCreated="gv_ProductsList_ItemCreated" OnInsertCommand="gv_ProductsList_InsertCommand"
                                            OnItemDataBound="gv_ProductsList_ItemDataBound"
                                        >
                                            <MasterTableView Name="gv_Products" CommandItemSettings-ShowRefreshButton="false" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="InPlace">
                                                <Columns>
                                                    <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></telerik:GridEditCommandColumn>
                                                    <telerik:GridTemplateColumn UniqueName="EmployeesObjectivesID">
                                                        <ItemTemplate></ItemTemplate>
                                                        <EditItemTemplate><asp:HiddenField runat="server" ID="hfEmployeesObjectivesID" Value='<%# Eval("EmployeesObjectivesID") %>' />
                                                            <asp:Label runat="server" ID="lblID" text='<%# Eval("ID") %>'></asp:Label>
                                                        </EditItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn UniqueName="ProductID">
                                                        <ItemTemplate><asp:Label runat="server" ID="lblProductDescription" Text='<%# Eval("Product") %>'></asp:Label></ItemTemplate>
                                                        <EditItemTemplate><telerik:RadComboBox runat="server" ID="rcb_Products" DataTextField="Product" DataValueField="ProductID" EmptyMessage="Select" ></telerik:RadComboBox></EditItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridTemplateColumn UniqueName="ObjTotal">
                                                        <ItemTemplate><asp:Label runat="server" ID="lblObjTotal" Text='<%# Eval("ObjTotal") %>'></asp:Label></ItemTemplate>
                                                        <EditItemTemplate><telerik:RadTextBox runat="server" ID="txtObjTotal" Text='<%# Eval("ObjTotal") %>'></telerik:RadTextBox></EditItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                            </MasterTableView>
                                        </telerik:RadGrid>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>



Everything works perfect, the problem I'm facing is when editing the inner grid....Which is the best method to be able to access the controls within the editTemplate and populate the drop down list i have there.
So far I've tried inner grid's methods OnItemDataBound, OnItemCreated; and it seems the EditTemplate controls aren't there I can only get the ones inside the item template.

any ideas??

Thks in advance...
Shinu
Top achievements
Rank 2
 answered on 20 Jan 2012
11 answers
403 views
hi everybody

how can multuply 2 columns in a radgrid, i have to show the total in a 3 column(no footer)  i have this code

For Each dataItem As GridDataItem In RadGrid1.Items
           Dim txt1 As Integer = Val(dataItem("Template1").FindControl("txtunidades"))
            Dim txt2 As Integer = Val(dataItem("Template2").FindControl("txtcunitario"))
            dataItem("Template3").FindControl("txtvtotal") = txt1 * txt2
        Next
Robert
Top achievements
Rank 2
 answered on 20 Jan 2012
1 answer
111 views
Hello all,

I have a require for some custom functionality, and I think the RadGrid will work for me based on the examples, however I'm not sure how start coding or setting it up. Below is a brief example of the functionality and layout...

//Initial Row State
[Read Only Label] [Empty Textbox] [ Default Dropdown] [ Default Dropdown] [Add Button]

When the [Add Button] is clicked, I'd like to take the values entered for the textbox and two dropdown menues, and "push" them down. At that point, the top row will be blank, and the bottom row will have the delete button like this.

//After item is added
[Read Only Label] [Empty Textbox] [Default Dropdown] [Default Dropdown] [Add Button]
[Read Only Label] [New Text Value] [New Dropdown Choice] [New Dropdown Choice] [Delete]

As mentioned, the examples give the add/delete functionality, but not in this manner. I'm not actually pulling data from anywhere, it would be more like a data entry form. I can't figure out how to keep the add button at the top and push the top row down when the add button is clicked. Thanks  for any suggestions, examples etc..

-Chris
Richard
Top achievements
Rank 1
 answered on 19 Jan 2012
2 answers
167 views
Hi,

Can you please tell how I can remove the 'Upload' option from the right click context menu in the FileExplorer control?

Thank you very much!

Kind regards,
Randy Sullivan
Randy
Top achievements
Rank 1
 answered on 19 Jan 2012
5 answers
136 views
Hello there,
I have a listbox inside a RadToolBar as below I want to do something only if the user confirms to do it, otherwise I want to just cancel.

What I need (Is there an example for this?):
1. Ideally I would like to use a RadWindow.Confirm to get a response and process based on Confirm or Cancel (popup using client script only).
2. I don't want a postback to happen if the user selects cancel on the popup.

(with the below code the postback happens even if args.set_cancel(result) and result is the Cancel response from the window.confirm) Is it because one of the container of the listbox is causing the postback?

Can you please help?

        <telerik:RadToolBar runat="server" ID="RadToolBar1" Width="100%" Skin="Windows7">
            <Items>
                <telerik:RadToolBarDropDown ImageUrl="~/app_themes/default/images/Check.png">
                    <Buttons>
                        <telerik:RadToolBarButton>
                            <ItemTemplate>
                                <telerik:RadListBox runat="server" ID="lbDoSomething" Skin="Windows7" SelectionMode="Single"
                                    OnClientSelectedIndexChanging="ConfirmDo" OnSelectedIndexChanged="lbDoSomething_OnSelectedIndexChanged"
                                    AutoPostBack="True" />
                            </ItemTemplate>
                        </telerik:RadToolBarButton>
                    </Buttons>
                </telerik:RadToolBarDropDown>
            </Items>
        </telerik:RadToolBar>
 
 
 <script type="text/javascript">
....
        function ConfirmOverride(sender, args) {
            var msg = "Are you sure you want to do something?";
            var result = !window.confirm(msg);
            args.set_cancel(result);
 
        }
</script>

Thank you,
Manas
Manas
Top achievements
Rank 1
 answered on 19 Jan 2012
1 answer
93 views
Title says it all really. Enquiring minds need to know. -- Stuart
Richard
Top achievements
Rank 1
 answered on 19 Jan 2012
1 answer
119 views
I have a radeditor,in that i have spans and a background image.I have some html input textboxes,on text changed of the textboxes,i'm binding the text to particular spans like:
<script>
 function txtTitlechanged(x) {
            var y = document.getElementById(x).value
            var editor = $find("<%=RadEditor1.ClientID %>");
            var oDocument = editor.get_document()
            var img = oDocument.getElementById('span1');


            if (y == '') {
                img.innerHTML = 'UserName';
            }
            else {
                img.innerHTML = y;
            }
        }
</script>

<input type='text' onchage="txtTitlechanged" />


Here i want that radeditor content as an image,i'm getting the radeditor content as html,but i want as it as an image.
Rumen
Telerik team
 answered on 19 Jan 2012
7 answers
231 views
I have a thierarchical grid needs to export.

I need to use  grid.ExportSettings.ExportOnlyData = false; becaues I need to keep the dropdown list template for my grid export.

But when export to excel I can see the expand image listed as a grey area in my excel export sheet. If it is a column, I know how to hide, but this doesn't seem to be a column on the grid. How can  I remove the grey expand area?

Thanks

 

Pavlina
Telerik team
 answered on 19 Jan 2012
4 answers
247 views
Hi,

Can you show me how to use RadProgressArea while loading data from a sql server?  Here is my scenario:

I have a RadButton.  when a user click on this button, I have a function call RetrieveData() and this function will connect to a sql database and query about 100,000 records and performing a lot of data manipulation so it will take awhile to produce desire data.

while processing the data, I would like to display like a progress bar so user can see what's going on and wait.  I found the demo here:
http://demos.telerik.com/aspnet-ajax/upload/examples/customprogress/defaultcs.aspx and really like it, but I don't know how to apply it to my scenario.  From the example, it sets the total process = 100, but in my case, my query run can take up to 3 minutes.  Please provide code as possible.  Here is my code behind page:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Do not display SelectedFilesCount progress indicator.
            RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;
        }
  
        RadProgressArea1.Localization.Uploaded = "Total Progress";
        RadProgressArea1.Localization.UploadedFiles = "Progress";
        RadProgressArea1.Localization.CurrentFileName = "Please wait while updating database... ";
    }

protected void RetrieveData()
{
        //using LINQ to SQL to select data
}

private void UpdateProgressContext()
    {
  
        RadProgressContext progress = RadProgressContext.Current;
  
        const int total = 100;
  
        progress.Speed = "N/A";
        for (int i = 0; i < total; i++)
        {
            progress.PrimaryTotal = 1;
            progress.PrimaryValue = 1;
            progress.PrimaryPercent = 100;
  
            progress.SecondaryTotal = total;
            progress.SecondaryValue = i;
            progress.SecondaryPercent = i;
  
            progress.CurrentOperationText = "Step " + i.ToString();
  
            if (!Response.IsClientConnected)
            {
                //Cancel button was clicked or the browser was closed, so stop processing
                break;
            }
  
            progress.TimeEstimated = (total - i) * 100;
             
            //Stall the current thread for 0.1 seconds
            System.Threading.Thread.Sleep(50);
        }
    }

protected void RadButton1_Click(object sender, EventArgs e)
   {
       UpdateProgressContext(); //I assume this is how it call
       RetrieveData();
   }
Please help, thanks in advance!
Han
Top achievements
Rank 1
 answered on 19 Jan 2012
0 answers
68 views
We are using the MVC grid control with Razor in VB.  When I attempt to bind to the grid, I get an exception when one of the date columns that is passed back in the model contains a null.  When it doesnt contain a null, then it works fine.  I do not want the grid to try to bind this column at all - I do not need it in this view.  Is there a way to limit the columns that the grid is trying to use? 

I found this entry which seems to address the problem, but I do not see how to apply this in a Razor view.  Can anyone help? 

Here is the code from my View:

 

 

@(Html.Telerik().
    Grid(Model).
    Name("Grid").
    Columns(Sub(columns)
                    columns.Bound(Function(o) o.DocumentId).Width(20)
                    columns.Bound(Function(o) o.StatusCode).Width(20).Title("Status")
                    columns.Bound(Function(o) o.LastName).Width(10).Title("LastName")
                    columns.Template(Function(o) Html.ActionLink("View", "View", New With {.id = o.Id}))
            End Sub).
        Pageable.
        Sortable)
    )

 

 

 

 

JT
Top achievements
Rank 1
 asked on 19 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?