This is a migrated thread and some comments may be shown as answers.

[Solved] Problem in adding default value to RADgridview using silverlight

1 Answer 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sulagna
Top achievements
Rank 1
sulagna asked on 08 Dec 2010, 11:21 AM
Hi
How can I add default value to RAD gridview.Which is the equivalent event for InitializeLayout in infragistics.
I need to modify the below code to silverlight in view model.Is there any DefaultValue property ?

protected void grdProjectIterations_InitializeLayout(object sender, LayoutEventArgs e)
        {
            IEnumerator<Iteration> iterEnum = getalliteration.GetEnumerator();
            int i = 0;
            //Finding the current row
            while (i < getalliteration.Count)
            {
                ++i;
                iterEnum.MoveNext();
            }
            Iteration iter = iterEnum.Current;
            //Finding the duration of the project
            if (SessionHelper<Project>.GetObjectFromSessionBag(SessionConstants.Project).ProjectId != 0)
            {
                Project projectWithDuration = CollectionUtil.getProjectForId(SessionHelper<Project>.GetObjectFromSessionBag(SessionConstants.Project).ProjectId);
                //Method to create iteration with default values
                _presenter = new ProjectIterationsViewPresenter(this);
                Iteration newIteration = _presenter.CreateNewIteration(projectWithDuration, iter);
                _iterationNo = newIteration.IterationNumber;
                e.Layout.Bands[0].Columns.FromKey("IterationNumber").DefaultValue = _iterationNo;
                e.Layout.Bands[0].Columns.FromKey("EndDate").DefaultValue = newIteration.EndDate;
                e.Layout.Bands[0].Columns.FromKey("StartDate").DefaultValue = newIteration.StartDate;
                e.Layout.Bands[0].Columns.FromKey("NoOfWorkingDays").DefaultValue = newIteration.NoOfWorkingDays;
                hdIterationDuration.Value = newIteration.NoOfWorkingDays.ToString();
                hdActualItDuration.Value = projectWithDuration.IterationsDuration.ToString();
            }
            e.Layout.Bands[0].Columns.FromKey("IterationMainGoal").Header.Caption = "Iteration Goal" + "<span style='color:Red;'>*</span>";
            e.Layout.Bands[0].Columns.FromKey("EndDate").Header.Caption = "End Date" + "<span style='color:Red;'>*</span>";
            e.Layout.Bands[0].Columns.FromKey("IterationStatusID").Header.Caption = "Status" + "<span style='color:Red;'>*</span>";

        }
Regards,
Sulagna

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 08 Dec 2010, 11:41 AM
Hi sulagna,

Can you tell us what exactly do you want to achieve and we will help you? What does the DefaultValue stands for?

All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
sulagna
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or