Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
467 views
I have Master grid when i selected row based on selcted row i have display more than two rad grids based on selected row for these rad grid i have add ,edit delete when i click add link it is oen rad window addd adding record and page reload but i dont want to reload page i want refresh which grid is i added recoed for that i have use following code

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
            </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdFiles">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdFiles" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdResource">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdResource" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdMessages">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdMessages" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdTasks">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdTasks" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

in code behind i wrote like this 

 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
           
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.Rebind();
           grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
           grdFiles.Rebind();


            grdResource.MasterTableView.SortExpressions.Clear();
            grdResource.MasterTableView.GroupByExpressions.Clear();
            grdResource.Rebind();


            grdMessages.MasterTableView.SortExpressions.Clear();
            grdMessages.MasterTableView.GroupByExpressions.Clear();
            //grdMessages.Rebind();
           
        }
        else if (e.Argument == "RebindAndNavigate")
        {
                RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            RadGrid1.Rebind();
            grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
            grdFiles.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            grdFiles.Rebind();
       
     
        }
    }

Please help me how to reslove this issue
Maria Ilieva
Telerik team
 answered on 12 Aug 2011
3 answers
195 views
Hello,
I have a template column which contains combobox with treeview inside, as described here. But, as it's all in grid TemplateColumn, I don't want those trees to load their content on initial page load, because this will make page too heavy. So I populate it from web service when user opens a dropdown box. Here is my javascript code:

var refCbTree;
var refCb;
function ReferenceComboBoxOpeningHandler(sender, args) {
    refCb = sender;
    refCbTree = $find(sender.get_attributes().getAttribute("treeID"));
    service.LoadReferenceRoot(sender.get_attributes().getAttribute("refID"), onRequestNodesSuccess);  
}
 
function onRequestNodesSuccess(result) {
    if (!refCbTree) return;
    refCb.trackChanges();
    refCbTree.trackChanges();
    for (i = 0; i < result.length; i++) {
        var node = new Telerik.Web.UI.RadTreeNode();
        node.set_text(result[i].Text);
        node.set_value(result[i].Value);
        refCbTree.get_nodes().add(node);
    }
    refCbTree.commitChanges();
    refCb.commitChanges();
}

So when service returns nodes, all nodes seem to be populated in tree, but tree won't resize and so with combobox. Attached is screenshot of what I see.
Is that possible to resize both controls to reveal their contents after loading nodes?
Thank you.
Dimitar Terziev
Telerik team
 answered on 12 Aug 2011
2 answers
104 views
Hello ... I built following simple chart binding to a sql datasource (stored procedure / pivot table)

<telerik:RadChart
                    ID="RC_Line1" runat="server"
                    DataSourceID="SDS_Chart_Line1"
                    DefaultType="Line"
                    Skin="Office2007"
                    AutoLayout="True"
                    SeriesPalette="Pal1"
                    Height="600px"
                    Width="800px"
                    IntelligentLabelsEnabled="True">
                    <CustomPalettes>
                        <telerik:Palette Name="Pal1">
                            <Items>
                                <telerik:PaletteItem MainColor="Yellow" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Blue" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Red" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Orange" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Green" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Cyan" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Magenta" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Gray" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="FloralWhite" SecondColor="Black"></telerik:PaletteItem>
                                <telerik:PaletteItem MainColor="Turquoise" SecondColor="Black"></telerik:PaletteItem>
                            </Items>
                        </telerik:Palette>
                    </CustomPalettes>
                    <Appearance Border-Visible="False"></Appearance>
                    <ChartTitle>
                        <Appearance>
                            <FillStyle MainColor=""></FillStyle>
                        </Appearance>
                        <TextBlock Text="Pappas AUT">
                            <Appearance TextProperties-Font="Arial, 18px" TextProperties-Color="Black"></Appearance>
                        </TextBlock>
                    </ChartTitle>
                    <Legend>
                        <Appearance Position-AlignedPosition="Right">
                            <ItemTextAppearance TextProperties-Color="Black"></ItemTextAppearance>
                            <ItemMarkerAppearance Figure="Square"></ItemMarkerAppearance>
                            <Border Visible="False" />
                        </Appearance>
                    </Legend>
                    <PlotArea>
                        <XAxis DataLabelsColumn="Year" LayoutMode="Normal"></XAxis>
                        <YAxis><Appearance MinorGridLines-Visible="False"></Appearance></YAxis>
                    </PlotArea>
                </telerik:RadChart>


My problem is, that column "year" is displaying on the yaxis (values 2005, 2006 ...) ... if I change the sql statement to
"SELECT 'Y' + CONVERT(VARCHAR(4),YEAR) as Year" the issue is gone.

Thank you...
Oliver
Top achievements
Rank 1
 answered on 12 Aug 2011
32 answers
660 views
Hello people,

I have a RadGrid that allow multiple selection...What i need is after the user select a few rows and after click on a button("DONE") I want to change that rows color for example to red and allow the reverse action...

For final I need to count  in real time, How many rows are Red(DONE) and how many aren't and show a dialog to inform it.

this is my RadGrid on aspx page:

div>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" ViewStateMode="Disabled" Width="97%"
            enableajax="True" CssClass="productsGrid" CellSpacing="0" AllowFilteringByColumn="True"
            ShowFooter="True" Skin="Black" AllowMultiRowSelection="True" OnItemCommand="RadGrid1_ItemCommand"
            OnGridExporting="RadGrid1_GridExporting" OnNeedDataSource="RadGrid1_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView GridLines="None" Width="100%" ViewStateMode="Disabled" CommandItemSettings-ShowExportToCsvButton="True"
                CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top">
                <Columns>
                    <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber"
                        UniqueName="SequencialNumber" SortExpression="SequencialNumber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Priorities.Priority" HeaderText="Priority" UniqueName="Priority"
                        FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Staging.Process" HeaderText="Staging" UniqueName="Process"
                        SortExpression="Process" FilterControlAltText="Filter Process column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SupplierCode" HeaderText="SupplierCode" UniqueName="SupplierCode"
                        SortExpression="SupplierCode" FilterControlAltText="Filter SupplierCode column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MessageStatus" HeaderText="MessageStatus" UniqueName="MessageStatus"
                        SortExpression="MessageStatus" FilterControlAltText="Filter MessageStatus column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DocumentType" HeaderText="DocumentType" UniqueName="DocumentType"
                        FilterControlAltText="Filter DocumentType column" SortExpression="DocumentType">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn UniqueName="InvoiceCreationDate" DataField="InvoiceCreationDate"
                        HeaderText="InvoiceCreationDate" FilterControlAltText="Filter InvoiceCreationDate column"
                        SortExpression="InvoiceCreationDate">
                        <FilterTemplate>
                            <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                            </telerik:RadDatePicker>
                        </FilterTemplate>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="SupplierVatNumber" FilterControlAltText="Filter SupplierVatNumber column"
                        HeaderText="SupplierVatNumber" SortExpression="SupplierVatNumber" UniqueName="SupplierVatNumber">
                    </telerik:GridBoundColumn>
                </Columns>
                <ExpandCollapseColumn Visible="False">
                    <HeaderStyle Width="19px"></HeaderStyle>
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>

this is my code behind:
public partial class InvoicesScalingDefault : Microsoft.Practices.CompositeWeb.Web.UI.Page, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
            }
            this._presenter.OnViewLoaded();
  
  
                        //string userLogin = Page.User.Identity.Name;
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
        private void LoadData()
        {
            //Popular dados na Radlist
  
            SapDocumentsBO sapDocs = new SapDocumentsBO();
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            if ((user == "xxx") || (user == "xxx"))
            {
                this.SapDocuments = sapDocs.GetSapDocuments();
                RadGrid1.DataSource = this.SapDocuments;
            }
            else
            {
                this.SapDocuments = sapDocs.GetSapDocumentsByUser(user);
                RadGrid1.DataSource = this.SapDocuments;
            }
  
        }
  
        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            LoadData();
        }
  
  
        /// <summary>
        /// Export de todos os SequencialNumber da tabela para .csv
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
            {
                RadGrid1.MasterTableView.Columns.FindByUniqueName("SequencialNumber").Visible = true;
                RadGrid1.ExportSettings.IgnorePaging = true;
  
                int count = 0;
                foreach (GridColumn column in RadGrid1.Columns)
                {
                    if (column.Visible)
                    {
                        if (count > 0)
                            column.Visible = false;
                        else
                            count++;
                    }
                }
  
            }
        }
  
        /// <summary>
        /// Método para formatar o sequencialNumber
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
  
    }
}
Ricardo
Top achievements
Rank 1
 answered on 12 Aug 2011
3 answers
110 views
Hi!

I use grouping and paging in my grid. Sometimes a group will continue on the next page(s).

I wonder if anyone knows of a simple way to analyze a GridGroupHeaderItem to find out if the group either continues from the previous page or continues on the following page.

I know that I can analyze the DataCell.Text attribute but since my grid can be translated into several languages it might be a bit tricky.

Thanks
/Mats
Tsvetina
Telerik team
 answered on 12 Aug 2011
2 answers
83 views
Hello.

I have a problem with grid layouts.I use Webblue skin in my project.In most of pages,grids appear like normal but some of them just disrupting.Look at skin and pagings.Using same grid skin css all of them.

Please help me to solve this problem.
Pronic
Top achievements
Rank 1
 answered on 12 Aug 2011
1 answer
194 views
Hi Developer,
first I apologize for my english (it's not very good).  I'am a beginner with telerik, and I have some doubts with the RadGrid.

Actually I develop a WebApplication that uses Telerik Asp.Net ajax controls, exactly a I develop with the RadGridControl.
I like to read from a table (from database) and use a radgrid to show results from "query" (after I'll improve the example app to include "buttons" to do action like detail view, master/detail, etc).
Note: The table to read will have more record (actually has about 10.000)

I am trying to scenarios

a) RadGrid with SqlDatasource (and filtering)

In this case, I define a radgrid (radGrid1) which uses a SqlDatasource (sqlDatasource) only with SelectCommand ("select * from mytable")

In this case, I define a SqlDatasource, with a SelectCommand "select * from mytable"

# MyTableViewScenarioA.aspx

...
<!-- RadGrid  -->
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
    AllowSorting="True" CellSpacing="0" DataSourceID="SqlDataSource1"
    GridLines="None" PageSize="30">
...

<!-- SqlDatasource -->
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="connectionstring"
    
        SelectCommand="SELECT * from MyTable"></asp:SqlDataSource>

# MyTableViewScenarioA.aspx.cs


b) RadGrid with ObjectDatasource (and filtering)

In this case, I define a RadGrid (radGrid1) without datasource. And before I use the NeedDatasource method to set the radgrid1's datasource with a list. The list is get from a method of a service class that query database (this method creates a select query and return a list of a type object)

# MyTableService.cs
public class MyTableService
{
    public List<MyTable> Find(Dicctionary<string, object> parameters)
    {
        // List<MyTable> = "select * from mytable where ..."
    }

   .....
}

# MyTableViewScenarioB.aspx

...
<telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True"
        AllowSorting="True" PageSize="15"
        AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
        onneeddatasource="RadGrid2_NeedDataSource" Skin="Windows7">

...

# MyTableViewScenarioB.aspx.cs

....
protected void RadGrid2_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {

            MyTableService service = new MyTableService();

            Dictionary<string, object> parameters= new Dictionary<string, object>(5);

            DateTime datetimeTo = DateTime.Now;
            //DateTime datetimeFrom= datetimeTo .AddDays(-7);
            DateTime datetimeFrom= datetimeTo .AddDays(-45);

            parameters.Add("datetimeFrom", datetimeFrom);
            parameters.Add("datetimeTo ", datetimeTo );

            List<MyTable> myTableList = service .Find(parameters);

            this.RadGrid1.DataSource = myTableList ;
            //this.RadGrid1.DataBind();            
        }        
    }

...

I debug the application and I have some questions about radgrid

Q1) ¿Select is execute everty time when I click a "next page" ?
Note: In scenario B the answer is yes

Q2) If Q1 answer if yes considering scenario a). How I can optimize this?
If every time radgrid execute a select, the database return a big number of rows, but the grid limit the result considering page size.

Q3) If Q1 answer if no (considering scenario b). ¿Where is save the datasource?

Q4) In scenarioB. How I can use the values of the filter, in NeedDatasource, to create the dicctionary parametres use in Find method?
Note: asume that table "myTable" has four columns: column1 (int), column2 (string), colum3(number), colum4 (datetime)

Q5) How works radgrid filtering? When is applied the filter?
I like to know how works filterir, and when is applied.  In scenarioa is launch select command and before is aplied the filter or first is aplied the filter (to select query) and second is launch the query.
In first aproach, the select return all rows from database and after, dataset is filter. In second aproach, the database return the "correct" rows that match with the filter.

Q6) When I change a filter, radgrid reload the page. It's possible to avoid this feature?
I like to use a command button "Apply filters" similar to a tipical search form. The idea is to avoid reload the grid every time that a filter change (and avoid to query the database everty time)

Q7) There is a event to inform me that a filter have been change?
Note: this is importan if i use scenarioB. The idea is recalculate de parameters, every time a user change a filter.

Q8) If I use scenarioB, it's possible to save the list in the view state?
The idea, is use the save list every time that the user click on a specific page (in this case, this is no query in database). If the user change a filter, then, the list (datasource) should be recalculated.

Q7) Which of two scenarios is better to use ASP Net Ajax controls?
ScenarioA is the typical of the telerik examples. ScenarioB is  typical of a orm application (entity framework, nhibernate, etc) where the develop use bussines object indepent of database (and is desgined to use, for exampe with a mvc application. In this case, the search view constains a model that consist in a list<MyTable>)

Thank you so much for your help. Sorry for my english.
Regards.
Mira
Telerik team
 answered on 12 Aug 2011
4 answers
70 views
Hi,
I have problem here. I was trying to fill the tree structure with the DataTable contents. The data i'm going to fill the tree view is a collection of special characters.
As you can see below the node.text which is a RadTreeNode has the value "\WW\<a"



But when it is displayed on the screen it comes as
This looks like when biinding the "<a" is getting truncated.

Is there any way around it???

Plz help me with this as I'm stuck with this
regards
Swa
Plamen
Telerik team
 answered on 12 Aug 2011
3 answers
186 views
Hi,

I have radbutton and icon , like this:

<telerik:RadButton ID="myRadButton" runat="server" Text="" 
        CssClass="RadBtn" onclick="some_function">
         <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4"/>
</telerik:RadButton>

when I click on my radbutton "some_function" is fire, but when I click on the icon which is on  this button my function doesn't work.
Any ideas ?
thanks .
Slav
Telerik team
 answered on 12 Aug 2011
3 answers
159 views
Hello!

I'm having a problem while trying to get the selected Item from a RadListBox...

When i use the RadListBox1.SelectedItem.Value the value is allways null when i use a dictionary as my datasource, but the RadList has 26 rows....However i have other 2 listboxs whose datasource is an entity..i d'ont have any problem....
Here is my code:
public partial class AssignInvoices : Microsoft.Practices.CompositeWeb.Web.UI.Page, IAssignInvoicesView
    {
        private AssignInvoicesPresenter _presenter;
  
        //implemantaçao da propriedade
        public System.Collections.Generic.IList<Data.Users> Users
        {
            get;
            set;
        }
  
  
        public System.Collections.Generic.IList<Data.Priorities> Priorities
        {
            get;
            set;
        }
  
        public System.Collections.Generic.IList<Data.Staging> Staging
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
            }
            this._presenter.OnViewLoaded();
  
              
              
            Info x = new Info("xx", "xx", "xx,DC=xx,DC=xx");
  
  
            Dictionary<string, string> networkUser = new Dictionary<string, string>();
            networkUser = x.GetHierarchyTree("xx");
  
            Dictionary<string, string> aux = new Dictionary<string, string>();
  
            foreach (KeyValuePair<string, string> kvp in networkUser)
  
            {
                //kvp.Key = user de rede
                string userCompName = x.GetUserInfo("cn", kvp.Key);
  
                aux.Add(kvp.Key, userCompName);//Dictionary com key = user de rede e Value = nomeCompleto Utilizador
                  
            }
  
            RadListBox1.DataTextField = "Key";
            RadListBox1.DataValueField = "Value"; 
            RadListBox1.DataSource = aux;
            RadListBox1.DataBind();
  
              
            //Page.User.Identity.Name para ir buscar o login user
  
  
            //Popular dados na listbox users
            //RadListBox1.DataSource = this.Users;
            //RadListBox1.DataTextField = "UserName";
            //RadListBox1.DataValueField = "UserSap";
            //RadListBox1.DataBind();
  
          
  
            //Popular dados na listbox grupos
            RadListBox2.DataSource = this.Priorities;
            RadListBox2.DataTextField = "Priority";
            RadListBox2.DataValueField = "Priority";
            RadListBox2.DataBind();
  
  
            //Popular dados na listbox stagins
            RadListBox3.DataSource = this.Staging;
            RadListBox3.DataTextField = "Process";
            RadListBox3.DataValueField = "Process";
            RadListBox3.DataBind();
  
  
        }
  
        [CreateNew]
        public AssignInvoicesPresenter Presenter
        {
            get
            {
                return this._presenter;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");
  
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
        // TODO: Forward events to the presenter and show state to the user.
        // For examples of this, see the View-Presenter (with Application Controller) QuickStart:
        //  
  
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            string _UserValue = RadListBox1.SelectedItem.Value; //Gets the value of item in Users.
                          
            //string _text = RadListBox1.SelectedItem.Text;  //Gets the Text of items in the list. 
            List<string> _groups = new List<string>(); //create a list to store selected groups
            string _stg = RadListBox3.SelectedItem.Value; // create a list to store selected stagings
  
  
            if (RadListBox1.SelectedIndex > -1 && RadListBox2.SelectedIndex > -1 && RadListBox3.SelectedIndex > -1)
            {
  
                iConnect.InvoicesScaling.Data.UsersAssignDAO usrAssgnDAO = new iConnect.InvoicesScaling.Data.UsersAssignDAO(new EscalonamentoFacturasEntities());
                UsersAssign user = new UsersAssign();
  
  
                foreach (var grp in RadListBox2.SelectedItems)
                {
                    _groups.Add(grp.Value);  //store the selectItems on RadListBox2 to list groups   
  
                    //efectuar aqui o insert
  
                    user.InserDate = DateTime.Now;
                    int j;
                    Int32.TryParse(grp.Value, out j);
                    user.UserName = _UserValue;
                    user.Priority = j;
                    user.Staging = _stg;
  
                    //passar o objecto a inserir na tabela da bd
                    usrAssgnDAO.Add(user);
  
                    usrAssgnDAO.SaveChanges();
  
                }
  
                  
  
            }
            //else if(RadListBox2.SelectedIndex < -1  )
            //reportar erro
  
  
  
        }
    }
}
Peter Filipov
Telerik team
 answered on 12 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?