Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
296 views
This problem has driven me crazy, and I hope anybody from the staff can help me about.

I was building a RadGrid with EditMode="InPlace", I decided to not auto generate columns. The grids datasource will be a list of an object with two properties "Quantity" and "MaxQuantity". The user can configure Quantity, but it should not get higher than MaxQuantity obviously. This became my grid:

<telerik:RadGrid ID="trgComponents" runat="server" AllowPaging="false" Culture="de-DE"
    CssClass="RadGrid Components" AllowSorting="false" AutoGenerateColumns="false" ShowStatusBar="false" PageSize="999999"
    OnNeedDataSource="trgComponents_NeedDataSource">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn" EditText="Bearbeiten">
                <HeaderStyle Width="20px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn UniqueName="Quantity" HeaderText="Anzahl" ItemStyle-CssClass="editableCell" ItemStyle-HorizontalAlign="Right">
                <HeaderStyle Width="80px" />
                <ItemTemplate>
                    <asp:Label ID="lQuantity" runat="server" Text='<%# Eval("Quantity") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="trntbQuantity" runat="server" Type="Number" MinValue="0" MaxValue='<%# Convert.ToDouble(Eval("MaxQuantity")) %>' Text='<%# Bind("Quantity") %>' Width="77" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" EnabledStyle-HorizontalAlign="Right" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridNumericColumn UniqueName="MaxQuantity" HeaderText="Max. Anzahl" DataField="MaxQuantity" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" ReadOnly="true">
                <HeaderStyle Width="80px" />
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

For test purposes there is a static list of an object with ID-, Quantity- and MaxQuantity-Property that will be bound in the NeedDataSource event, so not really any logic in the code behind.
As you can see I use a TemplateColumn in the markup and eval the MaxQuantity in the MaxValue field. This works! I've set row one in edit mode programmically and I could not increase the RadNumericTextBox value across the MaxQuantity value, as desired.


Now I decided I want to use EditMode="Batch" with EditType="Cell", so I modified my RadGrid a bit:

<telerik:RadGrid ID="trgComponents" runat="server" AllowPaging="false" Culture="de-DE"
    CssClass="RadGrid Components" AllowSorting="false" AutoGenerateColumns="false" ShowStatusBar="false" PageSize="999999"
    OnNeedDataSource="trgComponents_NeedDataSource"
    OnPreRender="trgComponents_PreRender">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" EditMode="Batch">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
        <Columns>
            <telerik:GridTemplateColumn UniqueName="Quantity" HeaderText="Anzahl" ItemStyle-CssClass="editableCell" ItemStyle-HorizontalAlign="Right">
                <HeaderStyle Width="80px" />
                <ItemTemplate>
                    <asp:Label ID="lQuantity" runat="server" Text='<%# Eval("Quantity") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="trntbQuantity" runat="server" Type="Number" MinValue="0" MaxValue='<%# Convert.ToDouble(Eval("MaxQuantity")) %>' Text='<%# Bind("Quantity") %>' Width="77" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" EnabledStyle-HorizontalAlign="Right" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridNumericColumn UniqueName="MaxQuantity" HeaderText="Max. Anzahl" DataField="MaxQuantity" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" ReadOnly="true">
                <HeaderStyle Width="80px" />
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Now the problem appears: When I click on a cell and the RadNumericTextBox appears its MaxValue will be set to 70368744177664 internally, the constructed value. Hence, it will not take care when I cross the MaxQuantity value.

I was experimenting a bit, and it turns out, when I change to cell batch mode, it will only assign static values to my RadNumericTextBox. It will not run any binding expression. Instead, no matter I set the Text property of the RadNumericTextBox or not, when I click the cell it will take the Text from the Label in the ItemTemplate node and pass it to the Text property of the RadNumericTextBox in the EditItemTemplate.


How can I get rid of that, as I need to limit the Quantity amount based on the MaxQuantity amount on the specified object.


Thanks in advice!
Martin
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
117 views
I am having issues referencing a related GridBoundColumn to set its value based upon the selection of a RadComboBox inside the Insert Mode row.

Picture this:

A RadComboBox, followed by 6 GridBoundColumns in InPlace Insert Mode on a RadGrid.

When the value of the RadComboBox has changed, the OnSelectedIndexChanged event fires off, and I retrieve the values for placing into the 6 GridBoundColumns based upon the value of the RadComboBox in code behind. In that same event handler, I would like to take the values from the data retrieval and set the GridBoundColumns text values prior to the user selecting the Insert button control on the grid.

I am struggling with the proper sequence of code to access and set these 6 GridBoundColumns text values from within the handler for the OnSelectedIndexChanged event.

Can anyone give me a example snippet of code to perform this action? The Accessing cells and rows page (www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html) does not go enough into detail with the proper sequence of code to do this. It is too broken up to follow and it is mostly based upon grid handlers (i.e. ItemCreated, ItemDataBound, ItemCommand, UpdateCommand, InsertCommand or DeleteCommand) and not on a specific control's handler (i.e. OnSelectedIndexChanged of a RadComboBox).
 
Whoever replies to this thread, I thank you in advance for your help.

Eyup
Telerik team
 answered on 09 Sep 2014
1 answer
102 views
Hi, I'm using a tag like

<telerik:RadCalendar FirstDayOfWeek="Monday" ShowOtherMonthsDays="false">

to hide other days in the month. However, the space is still taken. so, for a month like September, there is an empty first row. What's the logic behind this. Can an empty first row be hidden?
Viktor Tachev
Telerik team
 answered on 09 Sep 2014
1 answer
384 views
Hi,

I have used AllowFilteringByColumn in the radgrid and the normal filtering is working ok. Now, one of the column of the grid is FirstName and the data type is string and normal filtering is working. When a firstname contains Leading Space and the filter criteria is 'Equal To' then no result shows  but when the criteria is 'contains' then it shows result. I want to show the show the 'Equal To' criteria result also.
So, how to handle leading space in the filter criteria is 'Equal To'.
Pl, help.

Thanks,

G.Sen
Viktor Tachev
Telerik team
 answered on 09 Sep 2014
1 answer
111 views

I have an application on a site that uses the radasync upload. It is a two part application process. Everyone fills out the first page and upon the answer of a question, it'll load the second page with a certain control. These controls all contain a rad async upload and all have the same temp folder path and have the same expiration timeout. Occasionally, in the error logs I see that some errors come with cannot find file in temp folder. I thought at first i thought that it was the expiration time out was set to 2 hours so i changed all of them to 5 hours, but that did not seem to resolve the issue as I keep receiving these messages. The application does not have a lot of questions so I do not think that it would take long to complete the application and the users should be able to complete the application before the time out expires. Could it be that since all controls are writing to the upload temp folder, that there is conflict?

Hristo Valyavicharski
Telerik team
 answered on 09 Sep 2014
3 answers
145 views
Hi,

I was wondering if anyone had any suggestions as to the cause of an issue we're experiencing with the radgrid under the following scenario.  A user enters filters for grid and the grid updates to reflect the data based on the grid.  Everything works like it should so far.  If the user clicks on the edit icon for an Item in the grid, then the user is taken to the correct editing page for that Item.  Again, everything working properly.  The issue is that if the user has filtered on the grid and leaves the page open for a while (e.g., 15-20 min) then when they click on the edit icon to edit an Item they are taken to the Item that would have been the first one listed in the grid if there were no filters (instead of the actual Item they had clicked on).

For example, lets say I have a grid that contains the names Andy, Bob, and Joe, and by default all the names are shown.  If I filter on the name 'Bob' then the grid updates to show only that row, and if I click on the edit icon for that row I'm taken to an editing page for Bob's data.  All of that works as expected.

However, given the same scenario, if I were to leave the page inactive for a while and then click on the edit icon for the single row in the grid then I'm taken to the editing page for Andy which is what would've been the first row had I not filtered on the grid.

The issue causes problems because our users think they're editing an Item that they filtered on when in actuality they're editing the wrong Item (which is whatever would be the first Item in their default grid with no filtering.

Hopefully my example makes sense!  
Konstantin Dikov
Telerik team
 answered on 09 Sep 2014
2 answers
190 views
Freinds,

We are using RAD Chart control to display bar graphs in our ASP.NET web application which worked fine on Dev and QA servers. But when it was moved to production box, it worked fine first day but next day it started giving error "Error Loading Chart Image". Please find the trace below for your reference

Request path: /OneViewDashboard/ChartImage.axd    User host address: 172.21.253.97    User: PMSI\SeK4211    Is authenticated: True    Authentication Type: Negotiate    Thread account name: PMSI\oneviewprodsvc Thread information:    Thread ID: 50    Thread account name: PMSI\oneviewprodsvc    Is impersonating: False    Stack trace:    at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)   at Telerik.Web.UI.ChartHttpHandler.ProcessRequest(HttpContext context)   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Please note that it started working after restarting application pool but need to know what could have caused this issue. Thanks in advance.

Thanks,
Satish 
Danail Vasilev
Telerik team
 answered on 09 Sep 2014
3 answers
128 views
Hello,

I would to understand , how i can save in my database a new task on a Event

When i use OnTaskInsert

How it's work  , there are no documentation ?

How this event it's Fire ?

thanks Olivier

protected void RadGantt1_TaskInsert(object sender, Telerik.Web.UI.Gantt.GanttEventArgs e)
       {
           foreach (var item in e.Tasks)
           {
               this.oGanttTacheBo.title =  item.Title;
               this.oGanttTacheBo.parentid = item.ParentID;
               this.oGanttTacheBo.OrderID = item.OrderID;
               this.oGanttTacheBo.start = item.Start;
               this.oGanttTacheBo.end = item.End;
               this.oGanttTacheBo.PercentComplete = item.PercentComplete;
               this.oGanttTacheBo.Expanded = item.Expanded;
 
               // Here i can save in my database or i make a sql script ?
              // How this event it's FIRE ?
                   this.oGanttTacheBo.Save();
 
 
           }
       }


protected void RadGantt1_TaskInsert(object sender, Telerik.Web.UI.Gantt.GanttEventArgs e)
        {
            foreach (var item in e.Tasks)
            {
                item.Title = "Nouvelle tache "+DateTime.Now.ToString();
                item.ParentID = null;
                item.OrderID = 10;
                item.Start = DateTime.Now;
                item.End = DateTime.Now.AddDays(1);
                item.PercentComplete = Convert.ToDecimal("0,2");
                item.Expanded = false;
                item.Summary = false;
                //Response.Write(item.Start);
                /*try{
                    this.oGanttTacheBo.Add();
                    this.oGanttTacheBo.gat_parent_id    = Convert.ToInt32(item.ParentID);
                    this.oGanttTacheBo.gat_order_id     = Convert.ToInt32(item.OrderID);
                    this.oGanttTacheBo.gat_title        = item.Title;
                    this.oGanttTacheBo.gat_start        = item.Start;
                    this.oGanttTacheBo.gat_end          = item.End;
                    this.oGanttTacheBo.gat_avancement   = item.PercentComplete;
                    this.oGanttTacheBo.gat_expanded     = item.Expanded;
                    this.oGanttTacheBo.gat_summary      = item.Summary;

                    this.oGanttTacheBo.Save();
                }catch (Exception ex) {
                    //Response.Write(ex.Message);
                    BusinessLayer.TransactionRollback("");
                }*/

                //Response.Write("tache ajoutée");
            }
        }
Bozhidar
Telerik team
 answered on 09 Sep 2014
1 answer
278 views
Hi,

We are using Radio Combobox with multi select checkbox. I need to fire a client side event on checbkox click and henceforth I would like to use OnClientItemChecked. But this event is not firing. If my page is under updatepanel then could it create an issue.

Here is my below code-

<script language="javascript" type="text/javascript">
        function OnClientItemChecked(sender, eventArgs) {
            var item = eventArgs.get_item();          
        }
</script>

<telerik:RadComboBox ID="ddlClient" runat="server" Width="172px"  AllowCustomText="True" OnClientDropDownClosed="onDropDownClosing" OnClientItemChecked="OnClientItemChecked"
                        HighlightTemplatedItems="true" Height="200px" EmptyMessage="Select Clients" Enabled="false" OnItemDataBound="ddlClient_ItemDataBound" CheckBoxes="True" EnableCheckAllItemsCheckBox ="true">
                        <Localization CheckAllString="Select All" />
                    </telerik:RadComboBox>

Thanks,
Punit Singhi
Aneliya Petkova
Telerik team
 answered on 09 Sep 2014
0 answers
152 views
Hi, 

This is my scenario, i am going to Insert/Edit/Delete in my grid using OnNeedDataSource.

while inserting or editing, I have a textbox called code (on code textbox changed event), i need to check the code against the database, if the code is exist i need to populate some values to below 3 textbox. 

Can you guys provide your inputs?
Velkumar
Top achievements
Rank 1
 asked on 09 Sep 2014
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?