Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
604 views
Hi ALL,

          I have used rad grid with inline editing functionality, i have define RadGrid_UpdateCommand event for updating record, when i click on update button event get fired, but in event i used following code

var  EditedItem: GridEditableItem;
       KeyValue: Int64;
       NewValues: Hashtable;

EditedItem := e.Item as GridEditableItem;
 
  KeyValue := Int64(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]['ID']);

  NewValues := new Hashtable;

 e.Item.OwnerTableView.ExtractValuesFromItem(NewValues, EditedItem);

But problem is here for NewValues hashtable i got null values, i didn't understand that what is the problem behind this.

I got the following error.

specified argument was out of the range of valid values. parameter name index

is there any problem to binding grid or something else.

Please help me.

Thanks
Kaushal
    
Mira
Telerik team
 answered on 19 Aug 2011
1 answer
63 views

hello every one ,

in my radgrid i bind empty row on in place.
When i click radbutton values are assign in that empty here 't assign ,
But My Problem is next time i click the radbutton befre assign value are clear in radgrid 

please refer the attachment below.

<telerik:GridTemplateColumn HeaderText="Service Provider">
                                <ItemTemplate>
                                    <telerik:RadTextBox ID="serviceprod" runat="server" Width="100px">
                                    </telerik:RadTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>


this my radbutton click assigned values


Label sno = (Label)RadGrid1.Items[hiddenval.Text].FindControl("Sno");
            int val = Convert.ToInt32(sno.Text);
            int val1 = val - 1;
            if (val1 == Convert.ToInt32(hiddenval.Text))
            {
                RadTextBox serviceprod2 = (RadTextBox)RadGrid1.Items[hiddenval.Text].FindControl("serviceprod");
                RadDateInput subrecdate2 = (RadDateInput)RadGrid1.Items[hiddenval.Text].FindControl("subrecdate");
 
                serviceprod2.Text = Servprod.Text;
                subrecdate2.SelectedDate = RecdDate.SelectedDate;
                hiddenval.Text = Convert.ToString(Convert.ToInt32(hiddenval.Text) + 1);
            }

Regards,
Mohamed,
Radoslav
Telerik team
 answered on 19 Aug 2011
1 answer
94 views
Hi,

For RadGrid, is there a way to assign different CSS to each column of the filter row?

I can assign CSS class to Header, Footer and Item columns by changing HeaderStyle.CssClass, FooterStyle.CssClass and ItemStyle.CssClass. But I don't know how to do that to Filter Row column.

TIA 
Shinu
Top achievements
Rank 2
 answered on 19 Aug 2011
4 answers
130 views
Hi Telerik,

I have a RadMultiPage created at design time. I add page views to it programatically. When I add just one page view to the RadMultiPage -- all is well. I am able to refresh the page, work with the page, etc etc. Everything is fine.

When I add a second PageView to the page I see the height of the page views awkwardly restricted.

I have ViewState disabled. I regenerate the controls in Page_Initialization. Here are all the relevant methods. Do note that I played around with this a fair bit, and am confident I am regenerating the controls properly... I realize that I am breaking the "Regenerate Tabs and PageViews when NOT postback), but because I have ViewState disabled this should not be the case.

Here is the code where I allow the user to create a new RadPageView dynamically. This is located inside of an event after the page has been rendered fully.
CormantRadPageView pageView = CreateLayoutForNewTab();
newTab.PageViewID = pageView.ID;
 
private CormantRadPageView CreateLayoutForNewTab()
{
    CormantRadPageView pageView = new CormantRadPageView();
    LayoutManager.Instance.MultiPage.PageViews.Add(pageView);
    StateManager.Save(pageView);
    return pageView;
}

public CormantRadPageView()
{
    ID = string.Format("RadPageView_{0}", Guid.NewGuid().ToString().Replace('-', 'a'));
    SetupBase();
    LayoutManager.Instance.RegisteredPageViews.Add(this);
}

SetupBase isn't relevant to the issue. I can confirm that the issue arises SOLEY on when I regenerate the second page view. 

This method is called in Page_Load:

public void RegeneratePageViews()
{
    foreach (var pageViewState in StateManager.GetStates<SerializableDictionary<string, RadPageViewSetting>>())
    {
        try
        {
            RadPageViewSetting pageViewSetting = pageViewState.Value;
            CormantRadPageView pageView = new CormantRadPageView(pageViewSetting);
            LayoutManager.Instance.MultiPage.PageViews.Add(pageView);
        }
        catch (Exception exception)
        {
            _logger.ErrorFormat("Error regenerating page views. Reason: {0}", exception.Message);
            throw;
        }
    }
}

Here I recreate the pageView with the same ID as was known before and re-add it to the MultiPage. The MultiPage does not know of this PageView, nor does it seem to retain any information from the old page state once I step into Page_Init (my fear of regenning in page_load).

I also call this method in Page_Load. It handles the corner-case of 'first time load' where there are no page views to regenerate. As such, I create the first one and save it off so that when the user refreshes the page it is regenerated instead of created anew.


public void RegeneratePageState()
{
    if (StateManager.GetStates<SerializableDictionary<string, RadPaneSetting>>().Any())
    {
        List<CormantRadPageView> pageViews = LayoutManager.Instance.MultiPage.PageViews.OfType<CormantRadPageView>().ToList();
 
        foreach (CormantRadPageView pageView in pageViews)
        {
            RegenerateSplitterChildren(pageView.Splitter);
        }
    }
    else
    //We are now creating the dashboard for the first time, so 'regenerate' to the default state.
 
        CormantRadPageView pageView = new CormantRadPageView();
        LayoutManager.Instance.MultiPage.PageViews.Add(pageView);
 
        CormantRadPane pane = new CormantRadPane { BackColor = Color.White };
        StyledUpdatePanel updatePanel = pane.CreateUpdatePanel();
        CormantRadSplitter radSplitter = new CormantRadSplitter { Visible = false };
        CormantRadDockZone dockZone = new CormantRadDockZone();
        updatePanel.ContentTemplateContainer.Controls.Add(radSplitter);
        updatePanel.ContentTemplateContainer.Controls.Add(dockZone);
        pane.Controls.Add(updatePanel);
 
        pageView.Splitter.Controls.Add(pane);
 
        StateManager.Save(radSplitter);
        StateManager.Save(pageView);
    }
 
    RegenerateDockZones();
    RegenerateDocks();
}

Okay, so this is a bulk of code, but basically all it says is "If there is no PageView, create our initial and save it."

This works well. I am able to create the initial PageView, it is the proper height. I am able to refresh the page and it retains its height information. If I close my page, reopen it, it still retains the correct height. I am confident that this is working for 1-pageview multipages.

I have attached two images which highlight my issue with accompanying HTML mark-up.

Is this a common issue? Thanks.

Sean

Peter
Telerik team
 answered on 19 Aug 2011
1 answer
112 views

I'm pretty new to the Telerik controls, I'm looking for the best way to bind the following custom object to a RadGrid:

public class LevenshteinMatch
{
    public string SourceA { get; set; }
    public string SourceB { get; set; }
    public List<LevenshteinScore> editScore { get; set; }
}
public class LevenshteinScore
{
    public string PartA { get; set; }
    public string PartB { get; set; }
    public int Score { get; set; }
}

Thanks.
Princy
Top achievements
Rank 2
 answered on 19 Aug 2011
0 answers
96 views
Hi,

I have two questions wrt scheduler.

1. I have checkboxes on each time slot, for the blocked timeslot, the check boxes are getting overlapped by the appointment, PFA the screenshot ChkboxOverlapped.jpg. How can I resolve this?

2. I need check box for the blocked appointments and there should be only one check box per appointment irrespective of the timeslot. Please suggest me the way.

Thanks,
Navya

Navya
Top achievements
Rank 1
 asked on 19 Aug 2011
1 answer
124 views
Hi,

is it possible to show a contextMenu with different items according to the item clicked. By example, for this treeView :

    LevelA1
    LevelA2
        Level2A
        Level2B
    LevelA3

Level2A et Level2B will have a context menu that show "Edit" and LevelA1-A2 will show "ADD" and LevelA3 will show "Delete". 

Thank you.
Princy
Top achievements
Rank 2
 answered on 19 Aug 2011
1 answer
125 views
Hi,

I was binding the RadGrid using NeedDataSource w/ a generic collection to separate the presentation from data layer. during the binding, I kept receiving a message that points to the column for my DataKeyNames in the MasterTableView - ResultsID

<

 

 

MasterTableView ShowFooter="false" DataKeyNames="ResultsID" EditMode="InPlace"

 

 

 

CommandItemDisplay="TopAndBottom">

...the error points back to my generic collection for this column..the column exists within my code though....is there anything special that I should know?

 

 

 

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

 

{

 

 

using (dl = new WellVentDataLayer())

 

{

 

 

BindingList<WellVentEvents> oEvents = dl.GetWellVentEvents();

 

RadGrid1.DataSource = oEvents;

}

 

}

Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Aug 2011
4 answers
155 views
Hi

Two Questions here. Need answers seperately.

1. Can I have seperate template for Edit and Insert  insead of

<

 

 

EditFormSettings EditFormType="Template" .....>


2. Is is possible to have Inline editing while modifying a record and
<EditFormSettings, Template> way for Insert a new reocord ?  (in the same grid)

Regards



 

Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Aug 2011
1 answer
75 views
Is it necessary to set EnableMultiSelect="false" property to show multiMonthview calender?
Shinu
Top achievements
Rank 2
 answered on 19 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?