Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
292 views

Hi,

Perhaps someone can help me out. I am trying to do something that should be extremely easy with OpenAccess. Complex DataBinding to a textbox. I have not been able to accomplish this with OpenAccess. I have been trying this unsuccessfully for 3-4 weeks. Does anyone know how to do this? If so, could you please post some example code. I am using SQL Server Compact 3.5 and WinForms.

I can successfully add, update, and delete records from one table in a grid. Nothing else works.

Also, Telerik support has been terrible. They take many days to give an ambiguous answer. So far they are the worst support I have encountered. I regularly deal with <admin>company name removed</admin> and <admin>company name removed</admin>. Also, I have had great success with <admin>product name removed</admin> as an ORM. This product works very well however crud is painful (lots of code). This is why I was interested in OpenAccess. Telerik advertises it as great for CRUD. I'm hoping someone can help me before I throw this product in the garbage.

Rene

Olivier
Top achievements
Rank 2
 answered on 16 Nov 2014
4 answers
491 views
I've 10 dropdownlist in one page. I want to bind this dropdownlists from client side. In jquery I just pass the dropdownlists id using ajax from client side to server side then I bind the data using jquery. But in telerik how can I do that. I am new here. So I don't know how to do that. Can any one help me please.
Jahangir
Top achievements
Rank 2
 answered on 16 Nov 2014
1 answer
486 views
Hi,

i have an issue with maintaining state of template column textbox on paging in radgrid.
I am storing the data in session and then on need datasource event trying to get the data again from session.
But this does not help.
Please help me its urgent issue.please refer code below-






<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="grChecklist1" runat="server"  AutoGenerateColumns="false"
            onneeddatasource="grChecklist1_NeedDataSource" 
        onpageindexchanged="grChecklist1_PageIndexChanged" >
   <MasterTableView  AllowPaging="true" AutoGenerateColumns="false"  PageSize="5"> 
    <Columns>
    <telerik:GridTemplateColumn DataField="Number" HeaderText="Number" Visible="true">
    <ItemTemplate>
         <asp:TextBox ID="txtNumber" runat="server" Text='<%#Bind("Number")%>'/>
    </ItemTemplate>
   </telerik:GridTemplateColumn>
    <telerik:GridTemplateColumn DataField="TaskDescription" HeaderText="TaskDescription" Visible="true">
    <ItemTemplate>
         <asp:TextBox ID="txtTaskDescription" runat="server" Text='<%#Bind("TaskDescription")%>' />
    </ItemTemplate>
   </telerik:GridTemplateColumn>
   </Columns>

</MasterTableView>
</telerik:RadGrid>
   

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadDetails();
            }
        }

        private void LoadDetails()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Number",typeof(string));
            dt.Columns.Add("TaskDescription", typeof(string));
            dt.Rows.Add("1", "task1");
            dt.Rows.Add("2", "task2");
            dt.Rows.Add("3", "task3");
            dt.Rows.Add("4", "task4");
            dt.Rows.Add("5", "task5");
            dt.Rows.Add("6", "task6");
            dt.Rows.Add("7", "task7");
            //grChecklist.DataSource = dt;
           // grChecklist.DataBind();
            Session["dt"] = dt;

        }

        private void RefreshSessionState()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Number", typeof(string));
            dt.Columns.Add("TaskDescription", typeof(string));
            
            foreach (GridDataItem item in grChecklist1.Items)
            {
              string number=(item.FindControl("txtNumber") as TextBox).Text;
              string task = (item.FindControl("txtTaskDescription") as TextBox).Text;
              dt.Rows.Add(number,task);
            }
            if (Session["dt"] != null)
                Session.Remove("dt");
            Session["dt"] = dt;
        }

       

        protected void grChecklist1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
           // RefreshSessionState();
            grChecklist1.DataSource = (DataTable)Session["dt"];

        }

        protected void grChecklist1_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            grChecklist1.AllowPaging = false;
            grChecklist1.Rebind();
           // RefreshSessionState();
           
            grChecklist1.CurrentPageIndex = e.NewPageIndex;
            grChecklist1.AllowPaging = true;
            grChecklist1.Rebind();
        }
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 15 Nov 2014
9 answers
286 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
96 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
78 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
462 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
110 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
379 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
474 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?