Click here to Skip to main content
15,888,287 members
Home / Discussions / C#
   

C#

 
GeneralRe: which is the best language to learn PinPopular
V.19-Feb-12 21:34
professionalV.19-Feb-12 21:34 
GeneralRe: which is the best language to learn Pin
GParkings19-Feb-12 23:20
GParkings19-Feb-12 23:20 
GeneralRe: which is the best language to learn Pin
Dave Kreskowiak20-Feb-12 8:43
mveDave Kreskowiak20-Feb-12 8:43 
GeneralRe: which is the best language to learn Pin
jschell20-Feb-12 10:10
jschell20-Feb-12 10:10 
GeneralRe: which is the best language to learn Pin
Not Active20-Feb-12 8:48
mentorNot Active20-Feb-12 8:48 
GeneralRe: which is the best language to learn Pin
jschell20-Feb-12 10:18
jschell20-Feb-12 10:18 
AnswerRe: which is the best language to learn Pin
thatraja1-Mar-12 7:43
professionalthatraja1-Mar-12 7:43 
QuestionGet the value of the onCheckedChecked event Pin
MacIntyre19-Feb-12 12:59
MacIntyre19-Feb-12 12:59 
I am using a Telerik RadGrid Control.
I am using Entity access to backend SQL Server
I get the data from the DB Table just fine.
THe onClickedChanged event is firing.
The problem is I don't have a clue which of the 10 possible rows the checkbox event was envoked. The Chick is changing the visual presentation of the CheckBox (On/Off) but db.SaveChanges() is not writing the change back to the database.

ASP Code follows --- then C# ----
<asp:Content ID="Content1" ContentPlaceHolderID="placeholderMain" Runat="Server">
<div>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="grdDepartments">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdDepartments" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="grdDepartments" runat="server" AutoGenerateColumns="False"
CellSpacing="2" GridLines="None" Width="60px" AllowAutomaticInserts="true"
AllowAutomaticUpdates="true" OnItemUpdated="RadGrid1_ItemUpdated"
OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" >
<MasterTableView DataKeyNames="DepartmentID" >
<Columns>
<telerik:GridBoundColumn DataField="DepartmentID" HeaderText="Department ID" ReadOnly="True"
UniqueName="DepartmentID" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Department1" HeaderText="Department" ReadOnly="True"
UniqueName="Department1">
</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Active" UniqueName="Active" DataField="Active"
AutoPostBackOnFilter="false">
<ItemTemplate >
<asp:CheckBox runat="server" ID="chkActive" Enabled="true" onCheckedChanged="chkActive_Click"
AutoPostBack="true" Checked='<%# DataBinder.Eval(Container.DataItem, "Active") %>' >
</asp:CheckBox >
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettings EditColumn-EditFormColumnIndex="2"/>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="btnSave" runat="server" Text="Save"
onclick="btnSave_Click">
</telerik:RadButton>
<telerik:RadButton ID="btnCancel" runat="server" Text="Cancel"
onclick="btnCancel_Click">
</telerik:RadButton>
</div>
</asp:Content>
------

{
public DataAccess.Dev_SiteEntities db = new DataAccess.Dev_SiteEntities();

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var GrdDepartmentsData = (from p in db.Departments
select new { p.DepartmentID, p.Department1, p.Active });
grdDepartments.DataSource = GrdDepartmentsData;
grdDepartments.DataBind();
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
bool blnStatus = false;
int intCount = 0;
int intRows = 0;
string strItem = "";

intCount = grdDepartments.Columns.Count;
strItem = grdDepartments.Items[0].KeyValues;
strItem = grdDepartments.Items[2].KeyValues;
db.SaveChanges();
}
protected void chkActive_Click(object sender, EventArgs e)
{
bool blnStatus = false;
int intCount = 0;
int intRows = 0;
string strItem = "";
blnStatus = (bool)grdDepartments.Columns[2];
strItem = grdDepartments.Items[0].KeyValues;
strItem = grdDepartments.Items[2].KeyValues;
db.SaveChanges();
}

-----
AnswerRe: Get the value of the onCheckedChecked event Pin
ProEnggSoft19-Feb-12 14:31
ProEnggSoft19-Feb-12 14:31 
GeneralRe: Get the value of the onCheckedChecked event Pin
BillWoodruff19-Feb-12 18:40
professionalBillWoodruff19-Feb-12 18:40 
GeneralRe: Get the value of the onCheckedChecked event Pin
ProEnggSoft19-Feb-12 19:35
ProEnggSoft19-Feb-12 19:35 
AnswerRe: Get the value of the onCheckedChecked event Pin
BillWoodruff19-Feb-12 18:39
professionalBillWoodruff19-Feb-12 18:39 
GeneralRe: Get the value of the onCheckedChecked event Pin
RichardGrimmer20-Feb-12 5:09
RichardGrimmer20-Feb-12 5:09 
QuestionVertical ProgressBar Pin
DerecL19-Feb-12 11:07
DerecL19-Feb-12 11:07 
AnswerRe: Vertical ProgressBar Pin
Pete O'Hanlon19-Feb-12 11:12
mvePete O'Hanlon19-Feb-12 11:12 
AnswerRe: Vertical ProgressBar Pin
Luc Pattyn19-Feb-12 11:55
sitebuilderLuc Pattyn19-Feb-12 11:55 
AnswerRe: Vertical ProgressBar Pin
BillWoodruff19-Feb-12 18:49
professionalBillWoodruff19-Feb-12 18:49 
QuestionActiveX Pin
lukluz19-Feb-12 6:31
lukluz19-Feb-12 6:31 
QuestionRe: ActiveX Pin
Eddy Vluggen19-Feb-12 6:56
professionalEddy Vluggen19-Feb-12 6:56 
AnswerRe: ActiveX Pin
lukluz19-Feb-12 8:30
lukluz19-Feb-12 8:30 
AnswerRe: ActiveX Pin
Shameel19-Feb-12 7:05
professionalShameel19-Feb-12 7:05 
AnswerRe: ActiveX Pin
Dave Kreskowiak19-Feb-12 8:19
mveDave Kreskowiak19-Feb-12 8:19 
AnswerRe: ActiveX Pin
Luc Pattyn19-Feb-12 8:50
sitebuilderLuc Pattyn19-Feb-12 8:50 
Questionsave or register password for next login form ... Pin
nassimnastaran19-Feb-12 6:12
nassimnastaran19-Feb-12 6:12 
QuestionRe: save or register password for next login form ... Pin
Eddy Vluggen19-Feb-12 6:54
professionalEddy Vluggen19-Feb-12 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.