vb.net - Gridview doesnt allow editing if give Column Names with Select New With () -
when using following data bind gridview in vb.net work fine , can edit cells when declare columns names doesnt allow me edit cell values reason thanks
dim bs new bindingsource bs.datasource = (from u in threecontext.dbcontext.skechersdeliveries u.isprocessed = false select u) bs.resetbindings(true) dgdeliverys.datasource = bs
this example how delcare column names instead of slect u have liek below
select new { leave.id, leave.leave_month, leave.leave_app_date, leave.leave_from_date, leave.leave_to_date, emp.emplname, leavetype.leavedesc, leave.leave_day }
i using following select
ordernumber dim bs new bindingsource
dim cfglocation int16 cfglocation = cfb.storelocation bs.datasource = (from u in threecontext.dbcontext.r3delivery u.isprocessed = false andalso u.location = cfglocation select ordernumber = u.ordernumber, barcode = u.tagbarcode, qty = u.qty, processed = u.isprocessed, notdelivered = u.isdelivered) bs.resetbindings(true) dgdeliverys.datasource = bs dgdeliverys.columns(0).readonly = true dgdeliverys.columns(1).readonly = true dgdeliverys.columns(2).readonly =true
column 3 qtry , should changedable see stop @ 2 when declare column names above can no longer double click , edit datagrid directly
i think should have....
dim bs new bindingsource bs.datasource = (from u in threecontext.dbcontext.skechersdeliveries u.isprocessed = false select new with{.id = u.fieldthatmapstoid, .leavemonth = u.fieldthatmapstoleavemonth, ....... .leave_day = u.fieldthatmapstoleave_day}) bs.resetbindings(true) dgdeliverys.datasource = bs
Comments
Post a Comment