Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
328 views
Hi,
How to Maintain the state(userid) of checked records  during paging in rad grid?
below is my code for reference.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True" AllowPaging="True"
           PageSize="5" AllowSorting="True"
           OnNeedDataSource="RadGrid1_NeedDataSource" CellSpacing="0"
           GridLines="None" ShowGroupPanel="True">
           <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
           <ClientSettings Selecting-AllowRowSelect="true" AllowDragToGroup="True">
               <Selecting AllowRowSelect="True"></Selecting>
           </ClientSettings>
           <MasterTableView DataKeyNames="UserId">
               <Columns>
                   <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
               </Columns>
               <PagerStyle AlwaysVisible="True"></PagerStyle>
           </MasterTableView>
       </telerik:RadGrid>
       <br />
       <asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" Width="130px"
           Height="25px" ValidationGroup="val" />
       <br />
and
public partial class GroupUserCreation : System.Web.UI.Page
{
    Globas obj = new Globas();
    CheckBox chkbox = new CheckBox();
    string GroupId="";
  
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
 
            DataTable dt1 = obj.GroupDetails();
            cmbgroupname.DataSource = dt1;
            cmbgroupname.DataTextField = "GroupName";
            cmbgroupname.DataValueField = "GroupId";
            cmbgroupname.DataBind();
        }
      
        
    }
 
    protected void Button1_Click(object sender, EventArgs e)
    {
        
        try
        {
            GroupId = cmbgroupname.SelectedItem.Value.ToString();
            foreach (GridItem item in RadGrid1.MasterTableView.Items)
            {
 
                GridDataItem dataitem = (GridDataItem)item;
                TableCell cell = dataitem["ClientSelectColumn"];
                CheckBox checkBox = (CheckBox)cell.Controls[0];
                if (checkBox.Checked)
                {
                    int userid = Convert.ToInt32(dataitem.GetDataKeyValue("UserId").ToString());
                    if (GroupId != null)
                    {
                        obj.InsertGroupUserCreation(Convert.ToInt32(GroupId), userid);
                    }
                }
 
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
     
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = obj.UserDetails();
        RadGrid1.DataSource = dt;
      
    }
 
 
     
}
Help needed,
Thanks
S
Top achievements
Rank 1
 answered on 15 Nov 2014
1 answer
134 views
I posted this question on StackOverflow: http://stackoverflow.com/questions/26935565/cannot-read-property-length-of-null-using-sender-set-selectedtogglestateinde

It would appear that this telerik thread holds some relevance: http://www.telerik.com/forums/radbutton-javascript-error

Note this issue is in the same project as the RadCombo thread I made: http://www.telerik.com/forums/client-side-eventargs-are-mutable 

Where 'navigating' the client state (control state or view state) using either sender or the event argument is not an issue.



If you could answer this question on SO, I would be greatful, but I do have a general question for this thread post. What is the underline mechanics of how telerik uses the client functions 'get_selectedToggleStateIndex()' or 'get_toggleStates()'.. what is '_functionality' and why is it null in my implementation (i.e. nested function as a promptcallback function)?
Brett
Top achievements
Rank 1
 answered on 14 Nov 2014
1 answer
122 views
Hi,

I'm using a GridTemplateColumn with an Image control in ItemTemplate. I'm using the ItemDataBound event to set the Image background, this all works fine. However when I click on a column to sort all the text columns are sorted correctly but the images do not move.

Here is my code:

ASPX:
<telerik:RadGrid ID="radGrid1" runat="server" AllowSorting="true" OnNeedDataSource="radGrid1_NeedDataSource" OnItemDataBound="radGrid1_ItemDataBound">
  <MasterTableView EditMode="Batch" AllowSorting="true">
    <Columns>
      <telerik:GridClientDeleteColumn ConfirmText="Are you sure?" ImageUrl="~/Images/icoDelete.png" />
      <telerik:GridTemplateColumn HeaderText="Color" UniqueName="RangeColor" DataField="RangeColor" ItemStyle-HorizontalAlign="Center">
          <ItemTemplate>
            <asp:Image ID="imgRangeColor" Height="15" Width="100%" runat="server" />
          </ItemTemplate>
          <EditItemTemplate>
            <telerik:RadColorPicker ID="colorPickerTemplate" runat="server" OnClientLoad="PickerLoad" ShowIcon="true" ShowEmptyColor="false" />
          </EditItemTemplate>
      </telerik:GridTemplateColumn>
    </Columns>
  </MasterTableView>
  <ClientSettings>
    <ClientEvents OnBatchEditGetCellValue="OnBatchEditGetCellValue" OnBatchEditSetCellValue="OnBatchEditSetCellValue" OnBatchEditGetEditorValue="OnBatchEditGetEditorValue" OnBatchEditSetEditorValue="OnBatchEditSetEditorValue" />
  </ClientSettings>
</telerik:RadGrid>

NeedDataSource and ItemDataBound events:
protected void radGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
  myTable = new DataTable();
 
  myTable.Columns.Add("RangeMin");
  myTable.Columns.Add("RangeMax");
  myTable.Columns.Add("ColorAux");
 
  if (ViewState["Table"] != null)
    myTable = (DataTable)ViewState["Table"];
 
  radGrid1.DataSource = myTable;
  ViewState["Table"] = myTable;
}
 
protected void radGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem & e.Item.IsDataBound)
  {
    GridDataItem item = (GridDataItem)e.Item;
 
    string color = ((DataTable)ViewState["Table"]).Rows[item.ItemIndex][2].ToString(); //Get ColorAux value
 
    (item["RangeColor"].FindControl("imgRangeColor") as System.Web.UI.WebControls.Image).BackColor = System.Drawing.ColorTranslator.FromHtml(color);
  }
}


Any sugest how I can fix that problem?

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 14 Nov 2014
8 answers
520 views
I do not want the selected row in a grid to turn dark. How do I turn that off?
Pavlina
Telerik team
 answered on 14 Nov 2014
1 answer
145 views
"Error: Sys.ArgumentException: Cannot deserialize empty string.
Parameter name: data
    at Function.Error$create (http://172.16.17.13/TPS/ScriptResource.axd?d=FXG2eRlUct0x2YANPPo-8ilEesFRotmWUZTTtTbR6ITuuZj3oR3zlBLe_w9PcTm80&t=7eabb20b:847:15)
    at Object.Sys._errorArgument (http://172.16.17.13/TPS/ScriptResource.axd?d=FXG2eRlUct0x2YANPPo-8ilEesFRotmWUZTTtTbR6ITuuZj3oR3zlBLe_w9PcTm80&t=7eabb20b:821:21)
    at Function.Error$argument (http://172.16.17.13/TPS/ScriptResource.axd?d=FXG2eRlUct0x2YANPPo-8ilEesFRotmWUZTTtTbR6ITuuZj3oR3zlBLe_w9PcTm80&t=7eabb20b:870:16)
    at eval (eval at evaluate (unknown source), <anonymous>:1:7)
    at Object.InjectedScript._evaluateOn (<anonymous>:730:39)
    at Object.InjectedScript._evaluateAndWrap (<anonymous>:669:52)
    at Object.InjectedScript.evaluateOnCallFrame (<anonymous>:781:21)
    at http://172.16.17.13/TPS/ScriptResource.axd?d=gPSyjbOxvf933YlPqlpl0YmZadBWoP66sOat4oEG8MTKCQNKKtGEnOjuOE0F3Kzm7F4jqlZABy0dzDopQVEKhQ2&t=ffffffff97e4f358:3:9011"

On Save, the changes made on the editor goes away leaving behind the original image loaded in rad image editor .
Secondly this works on My Local machine Very fine but when i deploy it on server the above mentioned exception occurs. i have also tried the solution posted in a thread to increase Json Limit but it does not do anything.
Slav
Telerik team
 answered on 14 Nov 2014
1 answer
430 views
Hi,

I have the following situation: I have multiple self-developed Web User Controls (ascx) in my web application. The user controls are holding different logic, for example a rather complex contact form.

Every page's content on the website, is edited throud RadEditor. Now I need a flexible way to dynamically load page content including one, two, three, x of my own custom user controls....

How can i accomplish this in a neat way with the RadEditor?

My own solution is, in the RadEditor's contentarea, to insert a reference to the user control like %%control:MyFancyUserControl%%, and then at runtime search for %%control:MyFancyUserControl%% and load the control when the page is rendered.
Marin Bratanov
Telerik team
 answered on 14 Nov 2014
13 answers
590 views
How can I avoid the dialog box to save?
I want to save the image directly (AllowedSavingLocation="Server") without the dialog.
I'm saving my edited image to the database....
Niko
Telerik team
 answered on 14 Nov 2014
1 answer
139 views
Is there a way to create a circular border around the gauge as opposed to the wrapper? I'm getting a square border but I would like the border to go around the gauge. I attached an example (gauge1) of what I'm getting and I attached an example (gauge2) of what I am trying to accomplish. Thank you.
Danail Vasilev
Telerik team
 answered on 14 Nov 2014
3 answers
155 views
Setting Enabled = False is not properly styling the RadButton. The disabled="disabled" attribute correctly shows in the generated markup (which causes the correct functionality of it not being able to be clicked); however, the outer anchor tag is not styled with the "rfdInputDisabled" class. I can only reproduce the issue in IE11  (I'm on 11.0.9600.17358). I have a code sample; however, the file filter is not allowing me to attach a .zip file.
Danail Vasilev
Telerik team
 answered on 14 Nov 2014
2 answers
128 views
Hi everybody,

I have an issue with a html chart in IE8. It's an area chart and it display well in Chrome, FF or a modern IE version. But when rendering in IE8 all points and lines are not well placed and almost not visible.

Does anybody got an idea ?

Thanks a lot,
Corentin
Danail Vasilev
Telerik team
 answered on 14 Nov 2014
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?