Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
131 views
Hi,
I have multiple textboxes on my page to maintain the order of a list.
I have a scenario where the user may delete the value in one of the text boxes and I want to update all the corresponding textboxes that follow the order.

So supoose I have 10 textboxes with the numbers 1 to 10. if the user deletes the text from the box with number 5 i want to update the text in the textboxes which follow 5 ie, through 6 -10 with the number 5-9.

Does this make sense?

Please let me know if this can be done?
Dimo
Telerik team
 answered on 28 Sep 2010
2 answers
74 views
Hi,

I am using a Rad Grid control inside a user control. I have to support automatic inserts and edits - the insert is implemented by clicking a button in the command item template, and the editing is done by double-clicking the row that contains the item. I have hooked it up with the RowDoubleClick event in the ClientEvents tag and have implemented a custom javascript logic that keeps track of the edited items and triggers ajax requests to the server using a RadAjaxManager. I would like to be able to commit any pending changes to the currently edited item, if I double-click on another one (and have only one active editor).

the code for this looks like

function RowDblClick(sender, eventArgs) {
        requestCommit(); // commits any changes to the server to be recorded.
        // initialize items that keep the currently selected row's data.
    }

function requestCommit() {
        var result = false;
         .....
         // if updating
         manager.ajaxRequest(...);// pass the data to the server to perform update
          // else if inserting
         manager.ajaxRequest(...);// pass the data to the server to perform insert
         // other code skipped for clarity
         return result; // result is true if request attempt was made
    }

function GridKeyPress(sender, eventArgs) {
        var c = eventArgs.get_keyCode();
        if (c == 13) {
            requestCommit();
        }
    }

This code works fine when I press the enter key - the data is successfully  submitted. However, I want to submit it when I doubleclick on another row - unfortunately nothing happens - Firebug says that the request was aborted. This happens on FF, IE7, 8 and chrome (I did not test it elsewhere). When I add an alert tag in the requestCommit method before it returns, all works fine.

Regards,
Ivaylo Slavov
Ivaylo
Top achievements
Rank 1
 answered on 28 Sep 2010
1 answer
116 views
I have a user control that I am using multiple times on a page.  This user control contains a RadAjaxManagerProxy which ties an update to a RadAjaxLoadingPanel which is absolutely positioned within the user control and set to IsSticky="true".  Everything works just fine, except the loading panel in the first user control is triggered by both user controls when I run the page.  It's like the second user control does not have it's own instance of the loading panel.

I apologize if this has been answered before, I searched for awhile and was not able to find a solution.  My code for the user control is posted below.

 

<style type="text/css">
.loadingpanel { position: absolute; }
.bottomright { position: absolute; bottom: 10px; right: 20px; }
.bottomcenter { position: absolute; bottom: 15px; width: 200px; left: 0px; right: 0px; margin-left: auto; margin-right: auto; text-align: center; }
</style>
  
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ddlCalcMethod">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlCalcParameters" LoadingPanelID="RadAjaxLoadingPanel1"
UpdatePanelHeight="" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
  
<table width="100%">
<tr>
<td class="label right cell1">Method:</td>
<td class="cell2">
<telerik:RadComboBox ID="ddlCalcMethod" runat="server" Width="175px" AutoPostBack="True" 
onselectedindexchanged="ddlCalcMethod_SelectedIndexChanged">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td colspan="2" style="padding: 0px;">
<asp:Panel ID="pnlCalcParameters" runat="server"></asp:Panel>
</td>
</tr>
</table>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="200" MinDisplayTime="500" Skin="" CssClass="loadingPanel" IsSticky="true" HorizontalAlign="Center" ClientIDMode="AutoID"
<div class="bottomcenter">
<asp:Image ID="imgAjaxLoading" runat="server" ImageUrl="~/Resources/images/ajax-loader.gif" AlternateText="Loading..." /> 
</div>
</telerik:RadAjaxLoadingPanel>
<div class="bottomright">
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" /> 
</div>

Maria Ilieva
Telerik team
 answered on 28 Sep 2010
1 answer
153 views
Is there a simple way to use AsyncUpload with multiple file selection and the File Explorer? The File Explorer control will work for our needs, but being able to select multiple files is important.

Thank You,

Nick Clark
Fiko
Telerik team
 answered on 28 Sep 2010
3 answers
82 views
Hello all,

I use a custom control to enable the user to hide or show columns. The settings are persisted in a user's profile. When loading the profile server side I use the Display property of a column in C# to set it's initial visibility. This works very well.

The horizontol grid size is larger then the available screen size so RadGrid correclty shows a scrollbar.

When a user wants to show a column that was not visible before then RadGrid does not recalculate the new scroll width required to show all columns. Let me make an example.

V=visible column, X=invisible column

The users profile has those initial column visibility settings:
0  1  2   3  4  5  6  7  8
V  V  X  V  X  V  V  V  X

So column 2, 4, 8 are invisible on initial load.

The user now wants to make column 2 visible. Client side I call showColumn with no postback to achieve this. RadGrid correclty makes column 2 visible but now column 7 is out of scroll range for the user. If the user goes to a different page by using the pager then RadGrid recalculates the scroll width and everything works as expected. The API doc does not give any hints on calling a method to recalculate the scroll width.

Is this a bug? Is there a workround to make RadGrid recalculate the scroll width? Do you need any further information?

I try Rad Grid 2010.2.713.35

I use the following resizing settings in ClientSettings->Resizing:
AllowColumnResize: True
AllowRowResize: False
ClipCellContentOnResize: False
EnableRealTimeResize: True
ResizeGridOnColumnResize: True
ShowRowIndicatorColumn: True

Michael


Veli
Telerik team
 answered on 28 Sep 2010
4 answers
136 views
Hello!

I've a RadGrid where the User can manage some data.

In Edit- or Insert-Mode the User should be able to provide some data, the data will be checked against a Webservice and the result should be visible in Edit-Mode so the User can view them and finally Click "Finsh" to save the data and end the Edit-Mode.

My Problem is, that I don't know how to handle the Button-Click, where the data is checked.

In ItemCommand I can handle the Button-Event, but I have no access to the EditForm (as far as I know)

protected void DataRadGridItemCommand(object source, GridCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case "CheckData":
            //Check data
            break;
    }
}

In ItemDataBound I have access to the Edit-Form, butI don't know how to handle the Button-Event.

protected void DataRadGridOnItemDataBound(object sender, GridItemEventArgs e)
{
    if (!(e.Item is GridDataItem)) return;
 
    if (e.Item.IsInEditMode)
    {
        var item = (GridEditableItem) e.Item;
        // Access the EditForm
    }
}

Any suggestions, hints?

Thanks in advance.

Dieter
Daniel
Telerik team
 answered on 28 Sep 2010
2 answers
117 views
Hi,

Is there a way to reset all changes made by the client-side (since the last postback) with a client-side script call. If not can I store the last server state in a custom attribute and restore it. I am using Q1 2010 version with checkboxes and reordering by drag and drop features.

Help is appreciated

Bye 

Morgan
richamo
Top achievements
Rank 2
 answered on 28 Sep 2010
2 answers
603 views
I have requirement to add Image in the RadGrid as Hyperlink

Code-Behind is like this

 Protected Sub radgrid1_ItemDataBound(ByVal source As Object, ByVal e As GridItemEventArgs)

            If (e.Item.ItemType = GridItemType.Item) Then

                Dim HtmlImg As New System.Web.UI.WebControls.Image
                HtmlImg = CType(e.Item.FindControl("ImgMachine"), System.Web.UI.WebControls.Image)

                Dim ProductId As New HiddenField
                ProductId = CType(e.Item.FindControl("hdnOrderNumber"), HiddenField)

                HtmlImg.Attributes.Add("onclick", "javascript:window.open('http://www.myshoppingCart.no/OpenShopPackageTracker.aspx?installationID=21140000023&orderNumber=" & ProductId.Value.ToString() & "'); return false;")


            End If

        End Sub

Please help me with inline code for this
Santodip
Top achievements
Rank 1
 answered on 28 Sep 2010
2 answers
48 views
URL that demonstrates the issue:
http://testbed.dragocactoid.com

I have two issues, I have gotten rid of the border surrounding the root level of the menu (CSS override .rmRootGroup {border: none !important;} )

However, as you mouse over the menu items there are top and bottom borders being displayed. I want those to go away, too.

Secondly, the background color of the non-root menuitems is different than the root menuitems.  I don't really care if the background color stays the same or "highlights", but I want all the menu levels to behave the same.

Does someone know which styles I have to override to accomplish this?

Thanks,
Ken
Yana
Telerik team
 answered on 28 Sep 2010
1 answer
55 views
Hi everybody,

I'm playing around with RadChart and I want to make the chart dynamic.
I use the flowing code:
private static int[] huidigJaar = {135, 115, 79, 51, 5}; // ToDo: Values uit webService
private static int[] vorigeJaar = {110, 135, 47, 46, 15 }; // ToDo: Values uit webService
 
 
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitRadChart();
                SetGraphValues();
            }
            RadChart1.Skin = "Pastel";
            base.OnLoad(e);
        }
 
        private void SetGraphValues() // Vullen van de Bars in de Grafiek
        {
            ChartSeries aantalSeries = RadChart1.GetSeries("Huidig Jaar");
            if (aantalSeries != null)
            {
                if (aantalSeries.Items.Count > 0)
                {
                    foreach (ChartSeriesItem seriesItem in aantalSeries.Items)
                    {
                        seriesItem.YValue = huidigJaar[seriesItem.Index];
                    }
                }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        aantalSeries.AddItem(huidigJaar[i]);
                    }
                }
            }
 
 
            ChartSeries aantalVorig = RadChart1.GetSeries("Vorig Jaar"); // Vorige Jaar
            if (aantalVorig != null)
            {
                if (aantalVorig.Items.Count > 0)
                {
                    foreach (ChartSeriesItem seriesItem in aantalVorig.Items)
                    {
                        seriesItem.YValue = vorigeJaar[seriesItem.Index];
                    }
                }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        aantalVorig.AddItem(vorigeJaar[i]);
                    }
                }
            }
        }
 
 
        private void InitRadChart() //Initalisatie van de Graph.. hier ook bepalen hoeveel bars.
        {
            // Titel van chart afhankelijk van wat we gaan tekenen.
            const string TITLETEXT = @"Aanvragen in {0} over de tijds periode {1}";
            RadChart1.ChartTitle.TextBlock.Text = string.Format(TITLETEXT,
                                             RadComboBox2.SelectedItem.Text,
                                             RadComboBox1.SelectedItem.Text);
                      
            RadChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new Font("Verdana", 10);
            RadChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = Color.LightSlateGray;
 
            RadChart1.AutoLayout = true;
            RadChart1.PlotArea.XAxis.AutoScale = false;   // Moet op False anders wordt de label niet getoont.        
            RadChart1.PlotArea.XAxis.AddItem("Aangevraagd");
            RadChart1.PlotArea.XAxis.AddItem("Uitgebracht");
            RadChart1.PlotArea.XAxis.AddItem("Gepasseerd");
            RadChart1.PlotArea.XAxis.AddItem("Vervallen");
            RadChart1.PlotArea.XAxis.AddItem("Pijplijn");
            RadChart1.PlotArea.YAxis.VisibleValues = ChartAxisVisibleValues.Positive;
            RadChart1.Appearance.BarOverlapPercent = 40; // Huidige bar over de vorrige heen leggen           
             RadChart1.Series.Clear(); 
 
            //Bars voor het vorige jaar.. Wordt gevuld bij SetGraphValues
            ChartSeries aantallenVorrig = new ChartSeries("Vorig Jaar", ChartSeriesType.Bar);
            RadChart1.AddChartSeries(aantallenVorrig);
            aantallenVorrig.Appearance.ShowLabels = false;
 
            //Bars voor het huidige jaar.. Wordt gevuld bij SetGraphValues
            ChartSeries aantallenHuidig = new ChartSeries("Huidig Jaar", ChartSeriesType.Bar);
            RadChart1.AddChartSeries(aantallenHuidig);
            aantallenHuidig.Appearance.ShowLabels = true;
            aantallenHuidig.Appearance.TextAppearance.TextProperties.Color = Color.Black;
        }
 
        protected void RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if ((RadComboBox1.SelectedItem != null) && (RadComboBox2.SelectedItem != null) )
            {
                InitRadChart();
                SetGraphValues();           
            }
        }
 

When I changed one of the RadCombo Boxes, the Title is updated perfectly but I get the,
extra serries in my chart.  
View screenshot.  

What is it, that I'm douing wrong ?




Erik
Top achievements
Rank 1
 answered on 28 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?