|
i have 3 gridview
on selected index change of first gridview(company), I populate second gridview(users) on second gridview selected index change i display a list of jobs that are available (in a listview) and list of jobs assigned (in gridview) and roles associated with that job (checkbox in a 3rd gridview)
when i need to assign a job to the user i simply do followings
1. click company from 1st gridview
2. click user from 2nd gridivew
3.select a property from available property
and click a button that adds a new record in the assigned gridview but i want to display the newly added row as soon as they hit assign button. i need to reselect the user to see the updated change. is there anyway i could achieve this without using session?
please advise.
|
|
|
|
|
Oh, you were crossposting. I see. Please don't do that.
If you want to update without postback, it has nothing to do with the session, it has to do with AJAX.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris
you have mentioned using either URL parameter or view state. now i cant use URL parameter as its a requirement.
here are few codes to help u understand.
Private Sub gvUsers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvUsers.SelectedIndexChanged
dsAssignedPropertyList = mydal.SecurityGetAssignedPropertyByUser(domainid, CompId, userid)
If Not dsAssignedPropertyList Is Nothing Then
gvAssignedProperty.DataSource = dsAssignedPropertyList
gvAssignedProperty.DataBind()
end sub
Protected Sub btnAssign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAssign.Click
Dim myDAL As New clsDAL
Dim result As Boolean = False
userid = CInt(lblUserId.Text)
propertyid = lbAvailableProperty.SelectedValue
result = myDAL.SecurityAssignProperty(userid, propertyid)
If result Then
lblMsg.Text = "updated"
Else
lblMsg.Text = "failed"
End If
End Sub
In first method i am populating gvAssignedProperty and in second method i managed to insert the record and display a message but i really want to show the added record in a grid. could you please help?
thanks
|
|
|
|
|
I re-queried the DB again in button click event and bind the data.
|
|
|
|
|
and you still have the issue ? What is the issue then ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So you're doing postbacks here, you said you wanted to avoid that ?
Is the issue that your postback adds a record but it's not visible when the postback ends ? You should be reading your datasource and databinding after you insert the record, or, in your prerender method. It depends on if you want to bind every time to save viewstate, or use viewstate to store records and save DB resources.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi! the issue is. I have a grid A which populate when selected index of parent grid B is changed.
In Grid A i have button template "Remove" which should remove the records. well for now it removes the record from DB but i need to again change the index of grid B to show updated record in a grid. so my issue is how could i display updated record in grid A right after I click remove.
cheers.
|
|
|
|
|
Hi everybody.
I have this porcion and i want ,from the onclick event, to get a simple string that is in the first column of the clicked row, in the gridview
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes["OnClick"] = ClientScript.GetPostBackClientHyperlink(this.GridView1, "Select$" + e.Row.RowIndex.ToString();
string thefirstvalue = <---- what here to get the value?
}
maybe another way to get a value from gridview?
please help me.
thanks
|
|
|
|
|
I would suspect what you need to do, is to put the value in your event args, instead of hte index.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Let's say I have a products list, click in a select field of the GridView and i want the near product of the near column
Select productname
Select productname
Select productname
I have the index of the clicked row whit the posted method, but how I get the productname of that row?
please.
Thanks.
|
|
|
|
|
If you have the index, you get the data from the datasource, I guess. But, if you have the data already when you write the code, it seems more sensible to pass the data back, while you have it. The onitemdatabound event would then be the best place to write the code that passes the value back ( I'd probably just pass it on the URL, if it was me )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
the index of the gridview is not the index in the DB, this productname is the primary key, so i want it.
The onitemdatabound is not one of the attributes of my GridView.
maybe somehow from onrowdatabound?
thank you very much for your help.
|
|
|
|
|
caradri wrote: maybe somehow from onrowdatabound?
Yeah, that's what I meant.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I would like to know whether it is possible to reload a page within an asp:UpdatePanel , or can one only reload the values of certain components?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I'm not sure if this is on the lines you are looking for but maybe have a look at ajax as that does postbacks without refrshing the entire page
hope this helps
|
|
|
|
|
Hi in vs2003 dll file name will be same as project name
But in vs2005 while publishing period how & where to say dll file name?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Don bother any time u already got u?
donn u?
|
|
|
|
|
Why did you ask this twice ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All
I need to implement Questions and Answers forums in my website.
it should be just like our CodeProject.com.
it should maintain hearachy of replies.
can anybody tell me how to imlement this in asp.net
please help me.
thanks.
|
|
|
|
|
Write the code.
I don't see what else I can tell you. You need a database to store the values, and you need to write code to display them. If you want a heirarchy, you need to store the id of the post you responded to and write code to thread the replies as you display them.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks Christian Graus .
can you tell me thta how can I maintain on interface.
I mean what control i should use for this so that I can get hearachy
should I use nested gridview or some other control also help.
thanks.
|
|
|
|
|
How can i enable or extend my visual studio 2005 compactible with .dbml files
or Object Relation or class diagram files
Any Idea
Please spent a moment for me
Riyam Hussain
SE
IDSi Technologies
Infopark, Kochin
|
|
|
|
|
One more doubt, when we will create one project in vs2003,
It will create bin folder with in that project...,
In that dll file will be create during compilation time...,
But in vs2005 i create one website in that i didnt get bin folder then where the dll file will be create in vs2005?,
Plz any one help me for vs2005
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
HI
In VS2005 the dll will created after publishing the website the bin folder will auotomatically created that time in publishing location that contains the DLL files.
Yogesh Agarwal
|
|
|
|
|
It mean?
while publish time if it will create bin and its dll,
suppose if i need that dll in another one project how can i use that one?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|