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
<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 />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; } }<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>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); }}