Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
88 views
Disregard this post. I figured out the (Read: My) problem...
Seth
Top achievements
Rank 1
 asked on 08 Jun 2008
2 answers
173 views
Dear all,

I follow the example that uses a WebUserControl as editform for Rad grid.

I got as Exception when pressing the update button at that line where I access the OwnertableView:
DataRow[] dr = Products.Select("ProductID = " + editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"]); 
The Exception says : ArrgumentOutOfRangeExeption 
"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

Here is the full EventHandler code:
protected void Grid2_UpdateCommand(object source,GridCommandEventArgs e)  
        {  
            GridEditableItem editable = e.Item as GridEditableItem;  
              
            UserControl uc = (UserControl) e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
            DataRow[] dr = Products.Select("ProductID = " + editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"]);  
              
            // Can not find the ID to update ....  
            if(dr.Length != 1)  
            {  
                Grid2.Controls.Add(new LiteralControl("Can not find Item to update!!"));  
                e.Canceled = true;  
                return;  
            }  
            try 
            {  
                Hashtable ht = CollectFormData(e);  
                ht["ProductID"] = (int)editable.OwnerTableView.DataKeyValues[editable.ItemIndex]["ProductID"];  
 
                SqlDataAdapter da = new SqlDataAdapter(productSelect, ConnObject);  
                  
                SqlCommandBuilder cb = new SqlCommandBuilder(da);  
              
                dr[0].BeginEdit();  
                foreach (DictionaryEntry entry in ht)  
                {  
                    dr[0][(string)entry.Key] = entry.Value;  
                }  
                dr[0].EndEdit();  
 
                ConnObject.Open();  
                da.Update(dataSet, "Products");  
            }  
            catch(Exception ex)  
            {  
                Grid2.Controls.Add(new LiteralControl("Can not update record !!"));  
                e.Canceled = true;  
            }  
            finally 
            {  
                ConnObject.Close();  
            }  
        } 

Best regards.
Waleed
Waleed Seada
Top achievements
Rank 2
 answered on 08 Jun 2008
2 answers
98 views
Hi,

I have 3 resource type as roomA, roomB, and roomC and 2 resource type as board1 and board2. 

roomA is reserved for 9am to 11am with board1 resource type.
now when I reserve roomB or roomC between 9am to 11am for the same date, I want to hide the resource reserved by roomA (which is board1) and display only board2 as an avilable resource for that period of time.

in other words, I'm looking to find out how can get the avilable resources only for the availabe time slots in the schedular.

Any help or suggestion would be appereciated.

Thank you,
-Sal
salman
Top achievements
Rank 1
 answered on 06 Jun 2008
6 answers
1.1K+ views
I have a Save button on my form.
On click of the save button i want to determine if the grid is in edit/insert mode (that is the row is not updated and grid is still open in edit/insert)

I am able to determine that is the grid has some rows however if it is the first row to be inserted I am unable to get the value.
I am doing something like this :

protected bool IsGridInEditInsertMode(RadGrid grid)
{
    if (grid.Items.Count > 0) // The grid has items
    {
        foreach (GridItem item in grid.Items)
        {
            if (item.IsInEditMode || item.OwnerTableView.IsItemInserted)
            {
                DisplayPopupMessage(name +
" is currently in edit mode. Please update or cancel before saving.");
                return true;
            }
            if (!item.HasChildItems)
            {
                if (item.Edit == true || item.IsInEditMode || item.OwnerTableView.IsItemInserted)
                {
                    DisplayPopupMessage(name +
" is currently in edit mode. Please update or cancel before saving.");
                    return true;
                }
            }
        }
// end foreach for gridItems.Count
    }
    else // the first record is inserted in the grid
    {
     }
}

Please help me achieve this.
newbie
Top achievements
Rank 1
 answered on 06 Jun 2008
4 answers
130 views
Hello,

I'm trying to get the RadToolTipManager to show a ToolTip no matter what part of the appointment they click on in the Scheduler.  For example, I have an appointment that spans for 5 days Monday through Friday.  The only time the RadToolTip fires is when they click on the starting day of the appointment in month view.  It will come up for Monday, but not Tuesday, Wednesday, etc. 

I think it's because only the first instance is added to the TargetControls.  Is there any way to get the other days to show the RadToolTipManager when clicked on?

Thanks,
David
Martin Gartmann
Top achievements
Rank 2
 answered on 06 Jun 2008
1 answer
131 views
I am not sure what is causing it, but for some reason I keep getting an assembly reference to Telerik.Charting added to my web.config file.

This is annoying because it is referencing a gac assembly (why is telerik.charting in my GAC? I didn't put it there), and when I copy the files to the production machine that does not have the Telerik.Charting in the GAC I get a compilation error because of it.  And I have to go in and remove it from the Web.config.

I don't use Telerik.Charting, so I am assuming another control that i drag onto a page from the toolbox is causing this assembly to appear.  Although I can't image what control it would be (I am using Telerik Script Manager, Grid, Combo box, and slider).

To summarize
1.  Why is Telerik.Charting in my GAC to begin with?
2.  What control has a dependency on Telerik.Charting?

Ves
Telerik team
 answered on 06 Jun 2008
3 answers
118 views
Hello
How can i change the appearance figure for a series programmatically?
For the Legend item its ok,by the marker appearance-figure.

thx in advance.
Ves
Telerik team
 answered on 06 Jun 2008
4 answers
168 views

Hello

I want to position my chart axis item below the x axis programmatically. For short text its ok. How can it be done?
Thank you.

 

 

Ves
Telerik team
 answered on 06 Jun 2008
1 answer
178 views
I have a highly frustrating problem that I am sure other developers must be experiencing as well.

I changed to the new RadControls for ASP.NET Ajax and tried publishing a website yesterday. To my amazement the site would not publish.

(At this point I should add that I have successfully published dozens of sites containing the old RadControls with no problem).

Back to the drawing board. Test simple Hello World website written in VS 2005. It publishes to the internet fine. Add some microsoft buttons, drop down boxes etc and it still publishes fine.

Add a splitter, 2 panes and a split bar and it runs fine in VS 2005 but will not publish. (The correct items were added to the bin when I put the splitter on the page and the correct reference is on the aspx page. Hence it runs fine in VS2005).

Why will the site not publish to the web? I added a RadScript manager to the page and hit the button on the smart tag that registers the new line in the web config, as Telerik advises when using the new controls. Still won't publish!

Any help?

Elliot
Erjan Gavalji
Telerik team
 answered on 06 Jun 2008
11 answers
420 views
I am using the RadGrid bound to an ObjectDataSource. Paging and sorting work out of the box, but filtering needs some extra work.

I am handling the Selecting event of the ObjectDataSource, to put the FilterExpression in the InputParameters for the ObjectDataSource. However the filter expression in the MasterTableView is in a very odd format:
(it["NAME"].ToString().StartsWith("ch"))
which is next to useless, is this some badly set option of the grid? I basically just dropped it on the form.

Also, the filter menu sort of works fine when you put in your filter criteria and click on the filter icon to select the filter type.
However, if you type in the filter box and press enter, a filter menu opens in the top left hand corner of the page with different options than the one on the column. Is it possible to have it use the default filter type when you press enter? I have tried using and not using AutoPostback, and I have seen that the CurrentFilterFunction is set to StartsWith (which is what I want, I don't really want a postback).
What is this other filter menu and how do I get rid of it?

One final thing, the Selecting event seems to be fired twice, once for the Select and once (I guess) for the SelectCount call... Is this normal?

Thanks. If someone is willing to help me I have a demo all ready to send / upload.

Thanks.
David
david
Top achievements
Rank 1
 answered on 06 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?