|
Hi,
I'm setting up a system (both web based and app based) where there will be roles and permissions. There will be build in roles with specific permissions, but users can also create custom roles, with a certain subset of permissions. So the standard role based security framework doesn't work for me. Could somebody give some pointers of how to setup a role and permission based security framework?
Thanks in advance,
Gidon
|
|
|
|
|
Hello
I have a big problem and don'tt know how to avoid it
basicly the problem is coming because I can't disable the automatic sort on a DataGridView (DGV)
1- I load a table with a query, on column (order) is sorted with ascending numeric values
2- The table is binded to a DGV
3- At this point I programaticaly renum the order column with a step 5 : 5, 10, 15, etc
It is OK
BUT if before to do the renum I sort the DGV on that column and immediately reset the property to notsortable, the automatic sort remain active
dgv_rit.Sort(dgv_rit.Columns["order1"], ListSortDirection.Ascending);
dgv_rit.Columns["order1"].SortMode = DataGridViewColumnSortMode.NotSortable;
So, for now nothing seems to be changed in the DGV because it was already sorted !
But if I renum now, everything goes wrong because the automatic sort is still active and each row I change is automaticaly sorted to another place !!!
Too bad !!
|
|
|
|
|
since you have binded it with table then it cannot be change (CMIMW)
but if you do change in datatable then it will work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello
Thank you
But what do you mean ?
I DO make the changes directly in the datatable
It works fine since I do not make any programatic SORT to the DGV
The problem comes when I sort the column programaticaly in the DGV
After that the DGV stils sort automaticaly on ANY changes to the datatable or manualy by the user
So the question is HOW to avoid that the DGV sort automaticaly
If it is not possible I probably have to feed a DGV manualy without any bind to a datatable
Too bad !
|
|
|
|
|
Hello Xmen
Is it possible to sort the datatable instead DGV maybe this is the solution ??
|
|
|
|
|
perhaps not, but you can do a trick
use Select(), it have a parameter named sortby, this function will return DataRow[], and then you can add those rows to your DGV
this will work as you want
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello
I will see what I can do with that
The goal is to allow the user to change a sequence on row using an order column
As long as the value are entered manualy, it works
If I do a sort (programaticaly) at any time, it stills work but the behaviuou of the DGV is changes : it sort now automaticaly
Considering that it is impossible to renu programaticaly because to renum I have to follow the order, so to follow the rows order in the DGV to acceed the datarow and gives a new number. If that new number directly affect the order in the DGV it can't works
I yhink this is a bug in DGV
|
|
|
|
|
One step beyond !
Yes ok
I can work better using Tables.Select()
However the Dgv autosort is still a pain !
|
|
|
|
|
hi all,
I have a question on COM components.
After usage of com component how to clean up the com component ,
Can someone suggest me how can i proceed ,
Thanks
Mukkanti
|
|
|
|
|
You have to explicitly clean the com object in your code.
Use override dispose function in class where you are using the com class and after using the com object clean it in your dispose function.
Sarvesh Upadhyay
Senior Software Engineer
Birlasoft India Ltd.
Microsoft Certified Professional Developer in Dotnet 2.0 Enterprise Application
|
|
|
|
|
Hello..
I have this code:
<br />
float x = 0.5f;<br />
float y = 1.0f;<br />
<br />
private void ProcessInput(float amountOfMovement)<br />
{<br />
Vector3 moveVector = new Vector3();<br />
<br />
KeyboardState keys = Keyboard.GetState();<br />
if (keys.IsKeyDown(Keys.Right))<br />
moveVector.X += amountOfMovement;<br />
if (keys.IsKeyDown(Keys.Left))<br />
moveVector.X -= amountOfMovement;<br />
if (keys.IsKeyDown(Keys.Down))<br />
moveVector.Y -= amountOfMovement;<br />
if (keys.IsKeyDown(Keys.Up))<br />
moveVector.Y += amountOfMovement;<br />
<br />
if (keys.IsKeyDown(Keys.Add))<br />
x += 0.1f;<br />
y += 0.1f;<br />
if (keys.IsKeyDown(Keys.Subtract))<br />
x -= 0.1f;<br />
y -= 0.1f;<br />
<br />
Matrix cameraRotation = Matrix.CreateRotationX(cameraAngles.X) * Matrix.CreateRotationZ(cameraAngles.Z);<br />
cameraPosition += Vector3.Transform(moveVector, cameraRotation);<br />
<br />
MouseState currentMouseState = Mouse.GetState();<br />
if (currentMouseState.X != previousMouseState.X)<br />
cameraAngles.Z -= amountOfMovement / 80.0f * (currentMouseState.X - previousMouseState.X);<br />
if (currentMouseState.Y != previousMouseState.Y)<br />
cameraAngles.X -= amountOfMovement / 80.0f * (currentMouseState.Y - previousMouseState.Y);<br />
Mouse.SetPosition(Window.ClientBounds.Width / 2, Window.ClientBounds.Height / 2);<br />
}
how to change it to gamepad code?
[img]http://img488.imageshack.us/img488/6241/signaturesakirahku9.jpg[/img]
|
|
|
|
|
|
Hello is there any simple way to determine which column in a datagridview is actually sorted ?
|
|
|
|
|
Hi,
DataGridView.SortedColumn is your friend.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
How to access the environment variables in C# ??
YRKL
|
|
|
|
|
I guess you don't know How to use google[^]
If you did, you would find answer to your question with a simple search.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I got a question about how sockets work it's kinda confusing.
public ServerConnection(IPAddress this_machine, UInt16 port)<br />
: base()<br />
{<br />
this.init_connection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
<br />
this.ip_end_point = new IPEndPoint(this_machine, (int)port);<br />
this.init_connection.Bind(this.ip_end_point);<br />
this.init_connection.Listen(2);<br />
<br />
this.init_connection.BeginAccept(new AsyncCallback(this.OnDataControlConnect), this.init_connection);<br />
}<br />
<br />
private void OnDataControlConnect(IAsyncResult ar)<br />
{<br />
this.data_control = (Socket)ar.AsyncState;<br />
this.data_control.BeginReceive(this.data_control_buffer, 0, 4, SocketFlags.None, new AsyncCallback(this.OnDataControlReceive), this.data_control);<br />
<br />
this.init_connection.BeginAccept(new AsyncCallback(this.OnDataConnect), this.init_connection);<br />
}
Now in the OnDataControlConnect method I cast the AsyncState method as a socket. Is the socket that was casted the same socket I passed in "this.init_connection.BeginAccept(new AsyncCallback(this.OnDataControlConnect), this.init_connection);"?
I hope I'm being clear enough I'm still trying to understand how sockets work.
Thanks.
|
|
|
|
|
I got another question: If the client shuts down, then disconnects the socket, how does the host know to disconnect as well?
I'm starting to get the hang of connecting, sending and receiving with sockets.
Thanks.
|
|
|
|
|
For your first question...
Yes... It's the same socket...
As for the second question, I'm not sure I understand...
But if I do, than you should do the following in the callback function you used when calling BeginReceive():
private void ReceiveCallback(IAsyncState state)
{
.
.
.
int receivedBytes = yoursocket.EndReceive(...);
if (receivedBytes <= 0)
{
}
else
{
}
.
.
.
} I wrote it the way I remember... So it may not be 100% accurate, but this is the main idea.
Good luck,
Shy
|
|
|
|
|
Thanks, your reply has helped me quite a bit.
modified on Sunday, March 23, 2008 9:35 PM
|
|
|
|
|
I've got another question. If a host has a socket open and BeginAccept has been called. Is it possible for a Client to be able to search for open sockets bound to a certain porta and detect that socket?
modified on Monday, March 24, 2008 12:55 PM
|
|
|
|
|
I need to change te text of some messageBox buttons...
Can anyone help me on that?
PC
|
|
|
|
|
pcaeiro,
You'll need to explain a bit more what you want to do.
Regards,
Gareth.
|
|
|
|
|
You will need ti develop your own message box.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
You have to write your own implementation, or use the new TaskDialog in Windows Vista (although I believe somebody has put together a .NET version that will run on XP as well - have a search here on Code Project for the article explaining it).
|
|
|
|