I have a datagrid that has objects that are not visible and I need to use
them in my Sql Statement.
The problem is they are not there when set as "visible=false", but they are
if set to true.
For example:
I have:
************************************************** ***************************************
<asp:BoundColumn DataField="Answer"
HeaderText="Answer"></asp:BoundColumn>
<asp:BoundColumn DataField="PositionID" visible="false"
HeaderText="PositionID"></asp:BoundColumn>
<asp:BoundColumn DataField="QuestionUnique"
visible="false" HeaderText="QuestionUnique"></asp:BoundColumn>
<asp:BoundColumn DataField="AnswerUnique" visible="false"
HeaderText="AnswerUnique"></asp:BoundColumn>
************************************************** *****************************************
Where only "Answer" is visible - the others are key fields that I need for
my Sql and don't really want them displayed.
In my update routine:
************************************************** ****************************************
Sub DataUpdate(S as Object, E as DataGridCommandEventArgs)
Dim oGrid as DataGrid = CType(S, DataGrid)
oGrid.EditItemIndex=Cint(E.Item.ItemIndex)
dim pc as TextBox = e.item.Cells(1).controls(0)
dim quc as TextBox = e.Item.Cells(2).controls(0)
dim auc as TextBox = e.Item.Cells(3).controls(0)
dim txtAnswer as TextBox=E.Item.Cells(0).Controls(0)
Dim sQuery as String = "SELECT TOP 6
Answer,PositionID,QuestionUnique,AnswerUnique from ScreenAnswers where
PositionID = '" & pc.text & "' and QuestionUnique = '" & quc.text & "'"
************************************************** ****************************************
This works fine if "pc", "quc" and "auc" have visibility set to true.
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID
= '' and QuestionUnique = '' and AnswerUnique = ''
If visibility is set to false,
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID =
'25' and QuestionUnique = '3' and AnswerUnique = '3'
How do I handle this?
Thanks,
Tom 2 1284
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl... I have a datagrid that has objects that are not visible and I need to use them in my Sql Statement.
Also, this is in the onUpdateCommand routine. The problem is they are not there when set as "visible=false", but they are if set to true.
For example:
I have: ************************************************** *************************************** <asp:BoundColumn DataField="Answer" HeaderText="Answer"></asp:BoundColumn> <asp:BoundColumn DataField="PositionID" visible="false" HeaderText="PositionID"></asp:BoundColumn> <asp:BoundColumn DataField="QuestionUnique" visible="false" HeaderText="QuestionUnique"></asp:BoundColumn> <asp:BoundColumn DataField="AnswerUnique" visible="false" HeaderText="AnswerUnique"></asp:BoundColumn> ************************************************** *****************************************
Where only "Answer" is visible - the others are key fields that I need for my Sql and don't really want them displayed.
In my update routine: ************************************************** **************************************** Sub DataUpdate(S as Object, E as DataGridCommandEventArgs) Dim oGrid as DataGrid = CType(S, DataGrid) oGrid.EditItemIndex=Cint(E.Item.ItemIndex) dim pc as TextBox = e.item.Cells(1).controls(0) dim quc as TextBox = e.Item.Cells(2).controls(0) dim auc as TextBox = e.Item.Cells(3).controls(0) dim txtAnswer as TextBox=E.Item.Cells(0).Controls(0) Dim sQuery as String = "SELECT TOP 6 Answer,PositionID,QuestionUnique,AnswerUnique from ScreenAnswers where PositionID = '" & pc.text & "' and QuestionUnique = '" & quc.text & "'" ************************************************** ****************************************
This works fine if "pc", "quc" and "auc" have visibility set to true.
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID = '' and QuestionUnique = '' and AnswerUnique = ''
If visibility is set to false,
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID = '25' and QuestionUnique = '3' and AnswerUnique = '3'
How do I handle this?
Thanks,
Tom
Never mind.
I just figured it out.
All I had to do was set all the fields that were invisible to ReadOnly and
then everything worked fine.
Tom.
"tshad" <ts**********@ftsolutions.com> wrote in message
news:eS**************@TK2MSFTNGP14.phx.gbl... "tshad" <ts**********@ftsolutions.com> wrote in message news:uj**************@TK2MSFTNGP12.phx.gbl...I have a datagrid that has objects that are not visible and I need to use them in my Sql Statement.
Also, this is in the onUpdateCommand routine.
The problem is they are not there when set as "visible=false", but they are if set to true.
For example:
I have: ************************************************** *************************************** <asp:BoundColumn DataField="Answer" HeaderText="Answer"></asp:BoundColumn> <asp:BoundColumn DataField="PositionID" visible="false" HeaderText="PositionID"></asp:BoundColumn> <asp:BoundColumn DataField="QuestionUnique" visible="false" HeaderText="QuestionUnique"></asp:BoundColumn> <asp:BoundColumn DataField="AnswerUnique" visible="false" HeaderText="AnswerUnique"></asp:BoundColumn> ************************************************** *****************************************
Where only "Answer" is visible - the others are key fields that I need for my Sql and don't really want them displayed.
In my update routine: ************************************************** **************************************** Sub DataUpdate(S as Object, E as DataGridCommandEventArgs) Dim oGrid as DataGrid = CType(S, DataGrid) oGrid.EditItemIndex=Cint(E.Item.ItemIndex) dim pc as TextBox = e.item.Cells(1).controls(0) dim quc as TextBox = e.Item.Cells(2).controls(0) dim auc as TextBox = e.Item.Cells(3).controls(0) dim txtAnswer as TextBox=E.Item.Cells(0).Controls(0) Dim sQuery as String = "SELECT TOP 6 Answer,PositionID,QuestionUnique,AnswerUnique from ScreenAnswers where PositionID = '" & pc.text & "' and QuestionUnique = '" & quc.text & "'" ************************************************** ****************************************
This works fine if "pc", "quc" and "auc" have visibility set to true.
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID = '' and QuestionUnique = '' and AnswerUnique = ''
If visibility is set to false,
Then sQuery = Update ScreenAnswers set Answer = 'Oracle' where PositionID = '25' and QuestionUnique = '3' and AnswerUnique = '3'
How do I handle this?
Thanks,
Tom
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: tshad |
last post by:
I have a datagrid that I want to add a new column to. This column will only
be visible under certain conditions. So I want to set the column
visible=false. Then when the right condition happens...
|
by: Randall Parker |
last post by:
One can set individual controls in Code Behind by giving the controls ID names and
then declaring corresponding objects for them in Code Behind and then setting Visible
= false or true for each...
|
by: GaryDean |
last post by:
(one of our developers posted this and it got no answer so I'm giving it
another try)
I'm converting a DataGrid utility component that previously used the columns
array to function as it has in...
|
by: RolfHerbert |
last post by:
Hi all,
Source code below. I am using an sqldatasorce to populate a datagrid.
I am using datakeyIds.
I am interested in two keys which I have added to the datakeyids,
however if either of the...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |